Cache settings

This commit is contained in:
Arkadiusz Fal
2022-12-13 12:09:20 +01:00
parent 8f2b570163
commit e4d583a263
6 changed files with 69 additions and 22 deletions

View File

@@ -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: {