Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants