Technically this is a workaround: Replacing the `ProfileViewModel!` with
a real optional (or no optional at all) most probably requires a rewrite
of the entire Profile-screen, including header etc. as the
`ProfileViewModel!` is used basically everywhere.
So the workaround is to use the existing account (at least until it is
updated and replaced) to not have the app crash when the user taps on
their profile too quickly (without an account, which this PR fixes). For
some reason, we persist the users very own profile, but never used it.
Technically this is a workaround: Replacing the ProfileViewModel! with a real optional affects the entire Profile-screen including the header etc. as this ProfileViewModel is used everywhere
This is basically a refactoring of the `ListBatchFetchViewModel`, it
does two things:
1. Remove the "Reload this every 30 seconds", which caused a delay on
several screens
2. When users reach the bottom of the ScrollView, new content is
requested
3. DIY: Use this mechanism everywhere
The previous mechanism worked like this: Check every second, if the user
reached the end of the scrollView. If so: `shouldFetch`. As we increased
"every second" to "30 seconds", this caused a significant delay on all
screens which used this mechanism.
Others brought their own solution to fetch new content when users
reached THE END, like the HomeTimeline or the FollowerList. From now
one, there's a suggested way to deal with this "We must do something
once the user reachs the end!!!!"-issue.
P.S.: I'm not so happy with the `Self.`-approach and if someone has a
better name for `scrollViewDidScrollToEnd`, I'd be also thankful for a
hint. Maybe it's me, but I would have loved to add a new method to the
`UIScrollViewDelegate`-protocol (without Protocol-inheritance). Maybe
someone knows a way to do this? For now we'll leave it like this as the
alternatives would add more complexity.
When the user uploaded new account information, it got saved, but nobody
informed `MainTabBarController` (on iPhone) (and others), that the
account got updated. The `.userFetched`-notification was never sent. But
to use the updated picture, this notification is required. This PR fixes
that. It also adds the Update-ability to the Sidebar (which is used on
iPad)
In other words: When the user changes their image, the TabBar (or the
Sidebar, on iPad) shows the new image now.