mirror of
https://github.com/yattee/yattee.git
synced 2026-10-26 06:32:53 +00:00
Keep one login's verdicts and content off another's
A feed failure recorded its verdict before checking whether anyone was still waiting for it, and the verdict resolves the *currently* selected account — so a 401 from a credential the app had already moved off could mark its replacement, or a different account, as rejected indefinitely. The instance browser drops its feed, subscriptions and playlists when the selected login changes. Nothing else there would notice: the instance, the tab and the "already has data" shortcut are all unchanged between two accounts on the same server. Caches are no longer discarded while the identity is unresolved. With iCloud Drive off the scope drops to unresolved on every activation and comes back the same, and the context reads as local in between — which looked like a move and threw the caches away several times a day. Local is always in the account picker again. Its feed needs a Yattee Server and reports that itself; with correction no longer moving away from local, leaving it out of the list made it unreachable once left. And the subscriptions view reloads when an instance is switched off, which moves reads to local without touching the context or any status.
This commit is contained in:
@@ -518,9 +518,14 @@ struct SubscriptionsView: View {
|
||||
.onReceive(NotificationCenter.default.publisher(for: .dataContextDidChange)) { _ in
|
||||
reloadForContextChange()
|
||||
}
|
||||
// Instances count for the same reason: switching one off
|
||||
// moves reads to local without touching the stored context
|
||||
// or any account status.
|
||||
.onReceive(NotificationCenter.default.publisher(for: .accountStatusesDidChange)) { _ in
|
||||
guard appEnvironment?.dataContextValidator.effectiveContext != loadedContext else { return }
|
||||
reloadForContextChange()
|
||||
reloadIfEffectiveContextMoved()
|
||||
}
|
||||
.onReceive(NotificationCenter.default.publisher(for: .instancesDidChange)) { _ in
|
||||
reloadIfEffectiveContextMoved()
|
||||
}
|
||||
.task(id: instanceConfigurationID) {
|
||||
LoggingService.shared.debug("SubscriptionsView task triggered, instanceConfigurationID: \(instanceConfigurationID)", category: .general)
|
||||
@@ -1338,6 +1343,11 @@ struct SubscriptionsView: View {
|
||||
|
||||
/// Loads subscriptions asynchronously from the current provider.
|
||||
/// For Invidious, this fetches from the API and creates temporary Subscription objects for UI.
|
||||
private func reloadIfEffectiveContextMoved() {
|
||||
guard appEnvironment?.dataContextValidator.effectiveContext != loadedContext else { return }
|
||||
reloadForContextChange()
|
||||
}
|
||||
|
||||
/// Drops what is on screen and reloads it for whatever context is current.
|
||||
private func reloadForContextChange() {
|
||||
loadedContext = appEnvironment?.dataContextValidator.effectiveContext
|
||||
|
||||
Reference in New Issue
Block a user