Subscribed channels cache

This commit is contained in:
Arkadiusz Fal
2022-12-10 21:08:03 +01:00
parent 971beddc8d
commit e9c219a76e
9 changed files with 97 additions and 23 deletions

View File

@@ -42,7 +42,8 @@ struct ContentView: View {
subscriptions.load(force: true)
playlists.load(force: true)
}
.onChange(of: accounts.signedIn) { _ in
.onChange(of: accounts.signedIn) { newValue in
guard newValue else { return }
subscriptions.load(force: true)
playlists.load(force: true)
}

View File

@@ -16,6 +16,8 @@ struct SubscriptionsView: View {
HStack {
Spacer()
CacheStatusHeader(refreshTime: model.formattedFeedTime, isLoading: model.isLoading)
#if os(tvOS)
Button {
model.loadResources(force: true)
@@ -27,8 +29,7 @@ struct SubscriptionsView: View {
}
.padding(.horizontal, 10)
#endif
CacheStatusHeader(refreshTime: model.formattedFeedTime, isLoading: model.isLoading)
}
}
.environment(\.loadMoreContentHandler) { model.loadNextPage() }
.onAppear {

View File

@@ -162,7 +162,6 @@ struct YatteeApp: App {
NavigationModel.shared.tabSelection = section ?? .search
subscriptions.load()
playlists.load()
#if !os(macOS)