The key change here is to store the image subscription in the MediaView’s disposeBag rather than the configuration’s, so that it is properly disposed of in the MediaView’s prepareForReuse().
For good measure, also adding MainActor on prepareForReuse and actual cancellation of all subscriptions before releasing them.
Fixes#1374 [BUG] Posts can load the wrong images
Key points:
- hide image view if there is no image to fetch or if none arrives.
- authorStackView needed to always be full width across the bottom, and needed alignment .fill to avoid having its contents squished to zero height sometimes
- new mainContentStackView seems to need .center alignment when the axis is horizontal in order to size correctly.
Fixes IOS-317
A large amount of change primarily to the view model layer, to make reasoning about the content reveal/hide state easier.
To prevent terrible scrolling jags while allowing the cells to be shorter when hiding content, the layout changes for content display state now happen before the cell is returned by the datasource provider and the tableview is reloaded when a status’s display mode changes.
Instead of publishing a list of filters, the StatusFilterService now publishes a struct that can apply those filters to any status in any context.
Also, we now use V2 of the filters API, which distinguishes between hide and warn.
Fixes #1354 [BUG] Mastodon iOS App Ignores "Hide completely" Filter action Setting
Filters used to be applied only at the display stage.
There is remaining work here:
- Hide filters still will not hide until we update Filter to use API V2.
- Filter work is now duplicated and should be made more efficient.
- It may be important to hold on to statuses even if they are hidden, so that they can be shown if the filter changes.
Contributes to #1354 [BUG] Mastodon iOS App Ignores "Hide completely" Filter action Setting
Give full responsibility for API calls to the AuthenticationViewModel.
Give (nearly) full responsibility for UI flow of the signup/log in experience to the WelcomeViewController.
Transition more APIService functions to async await.
Remove unnecessary AppContext vars.
Update helpful text on Log In screen.
Contributes to iOS-321
Files are removed when an app is deleted from device, but the Keychain is not cleared. So now if we find no cached account information upon launch, we remove any accounts remaining in Keychain and the app launches to the Welcome screen.
Fixes iOS-315
Further simplify the AuthenticationViewModel and the public interface of AuthenticationServiceProvider.
Publish currentActiveUser from AuthenticationServiceProvider instead of assuming all callers know to take the first in the list as the active one.
contributes to iOS-319
Creating async await alternatives to Combine publishers in cases where that makes sense.
Near term goal is to centralize responsibility for caching of user info.
contributes to iOS-319
Also, AppContext, APIService, and AuthenticationServiceProvider are now more obviously singletons.
And AuthenticationServiceProvider can now be asked for the current active user, instead of every caller assuming the first element of a list of users is the active user.
This change only affects users logged in to mastodon.social or mastodon.online. A banner may be periodically displayed at the bottom of the homescreen encouraging donations and menu options are now available in Settings to make new donations or manage existing ones.
Amounts will not necessarily be returned from the server in order. The first amount returned is taken as the default and the amounts are sorted before display.
---------
Co-authored-by: Marcus Kida <marcus.kida@bearologics.com>