Settings for iOS/macOS

This commit is contained in:
Arkadiusz Fal
2021-09-25 10:18:22 +02:00
parent 433725c5e8
commit a7da3b9468
64 changed files with 1998 additions and 665 deletions

View File

@@ -1,23 +1,28 @@
import Defaults
import Siesta
import SwiftUI
struct WatchNowSection: View {
@ObservedObject private var store = Store<[Video]>()
let resource: Resource
let label: String
@StateObject private var store = Store<[Video]>()
@EnvironmentObject<InvidiousAPI> private var api
init(resource: Resource, label: String) {
self.resource = resource
self.label = label
self.resource.addObserver(store)
}
var body: some View {
WatchNowSectionBody(label: label, videos: store.collection)
.onAppear {
resource.loadIfNeeded()
resource.addObserver(store)
resource.load()
}
.onChange(of: api.account) { _ in
resource.load()
}
}
}