Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

fixed two bugs when switching accounts from the ComposeView #123

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

dvorakroth
Copy link
Contributor

Summary

fixes issue #72

relevant quotes from there that pretty much sum it up:

Multiple accounts with different maximal chars available. When switching accounts while writing a post: available character count is not updated to the newly selected account.

and

if you tap your profile pic a second time to switch back to the original account, it won't show it in the menu

i fixed the first part by:

  • making CompositionViewModel.maxCharacters into a Publisher
  • making the character count recalculate when $maxCharacters is updated
  • updating maxCharacters via a helper method whenever NewStatusViewModel.$identityContext is updated

and i fixed the second part, in CompositionView, by moving the call to parentViewModel.identityContext.$authenticatedOtherIdentities.sink() into the trailing end of the callback given to parentViewModel.$identityContext.sink().

the problem there, originally arose because whenever the user switches accounts, the identityContext gets completely replaced by a new object. so when, later on, eventually, the new identityContext.authenticatedOtherIdentities got updated, nothing was subscribed to it. and so calling identityContext.$authenticatedOtherIdentites.sink() on every change to identityContext has fixed it

Other Information

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

1 participant