mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Cache settings
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import Defaults
|
||||
import SDWebImageSwiftUI
|
||||
import SwiftUI
|
||||
|
||||
@@ -5,6 +6,8 @@ struct ChannelsView: View {
|
||||
@ObservedObject private var subscriptions = SubscribedChannelsModel.shared
|
||||
@ObservedObject private var accounts = AccountsModel.shared
|
||||
|
||||
@Default(.showCacheStatus) private var showCacheStatus
|
||||
|
||||
var body: some View {
|
||||
List {
|
||||
Section(header: header) {
|
||||
@@ -81,14 +84,19 @@ struct ChannelsView: View {
|
||||
SubscriptionsPageButton()
|
||||
#endif
|
||||
|
||||
Spacer()
|
||||
if showCacheStatus {
|
||||
Spacer()
|
||||
|
||||
CacheStatusHeader(
|
||||
refreshTime: subscriptions.formattedCacheTime,
|
||||
isLoading: subscriptions.isLoading
|
||||
)
|
||||
CacheStatusHeader(
|
||||
refreshTime: subscriptions.formattedCacheTime,
|
||||
isLoading: subscriptions.isLoading
|
||||
)
|
||||
}
|
||||
|
||||
#if os(tvOS)
|
||||
if !showCacheStatus {
|
||||
Spacer()
|
||||
}
|
||||
Button {
|
||||
subscriptions.load(force: true)
|
||||
} label: {
|
||||
|
@@ -6,6 +6,8 @@ struct FeedView: View {
|
||||
@ObservedObject private var feed = FeedModel.shared
|
||||
@ObservedObject private var accounts = AccountsModel.shared
|
||||
|
||||
@Default(.showCacheStatus) private var showCacheStatus
|
||||
|
||||
#if os(tvOS)
|
||||
@Default(.subscriptionsListingStyle) private var subscriptionsListingStyle
|
||||
#endif
|
||||
@@ -22,11 +24,19 @@ struct FeedView: View {
|
||||
ListingStyleButtons(listingStyle: $subscriptionsListingStyle)
|
||||
#endif
|
||||
|
||||
Spacer()
|
||||
if showCacheStatus {
|
||||
Spacer()
|
||||
|
||||
CacheStatusHeader(refreshTime: feed.formattedFeedTime, isLoading: feed.isLoading)
|
||||
CacheStatusHeader(
|
||||
refreshTime: feed.formattedFeedTime,
|
||||
isLoading: feed.isLoading
|
||||
)
|
||||
}
|
||||
|
||||
#if os(tvOS)
|
||||
if !showCacheStatus {
|
||||
Spacer()
|
||||
}
|
||||
Button {
|
||||
feed.loadResources(force: true)
|
||||
} label: {
|
||||
|
Reference in New Issue
Block a user