Simplify video views

This commit is contained in:
Arkadiusz Fal
2021-07-28 00:40:04 +02:00
parent 52ffe19324
commit 5b0a3458f3
18 changed files with 374 additions and 404 deletions

View File

@@ -0,0 +1,24 @@
import SwiftUI
struct SubscriptionsView: View {
@ObservedObject private var store = Store<[Video]>()
var resource = InvidiousAPI.shared.subscriptions
init() {
resource.addObserver(store)
}
var body: some View {
VideosView(videos: store.collection)
.onAppear {
resource.loadIfNeeded()
}
.refreshable {
resource.load()
}
#if !os(tvOS)
.navigationTitle("Subscriptions")
#endif
}
}