mirror of
https://github.com/yattee/yattee.git
synced 2024-12-13 13:50:32 +05:30
25 lines
530 B
Swift
25 lines
530 B
Swift
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
|
|
}
|
|
}
|