Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Refactor UI components #135

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Refactor UI components #135

wants to merge 5 commits into from

Conversation

X1nto
Copy link
Member

@X1nto X1nto commented Apr 14, 2023

  • Separate stateless and stateful composables
  • Move ViewModel controlling from HomeScreen to individual panels
    • This removes the need for HomeScreen to call load() functions when data changes. Instead, ViewModels observe data changes themselves and update the UI accordingly. This should ensure that all data is updated properly.
  • Refactor navigation
  • Get rid of BasePersistenceViewModel
  • Refactor smaller components, such as messages, etc.

viewModelScope.launch {
val guild = guilds.fetchGuild(persistentGuildId)
?: return@launch
persistentDataStore.observeCurrentGuild()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does not need to be updated when the current guild changes (it won't except for a tiny edge case)

it should stay the same for as long as the screen is open

should probably add some getGuildId() or something to persistent store

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can just make it get the last value, no problems with that

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants