metabolist / metatext

A free, open-source iOS Mastodon client.
https://metabolist.org/metatext
GNU General Public License v3.0
727 stars 102 forks source link

fixed two bugs when switching accounts from the ComposeView #123

Open dvorakroth opened 2 years ago

dvorakroth commented 2 years ago

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:

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