mirror of
https://github.com/yattee/yattee.git
synced 2025-12-31 17:02:31 +00:00
Extended Piped support
This commit is contained in:
@@ -3,14 +3,14 @@ import Siesta
|
||||
import SwiftUI
|
||||
|
||||
struct WatchNowSection: View {
|
||||
let resource: Resource
|
||||
let resource: Resource?
|
||||
let label: String
|
||||
|
||||
@StateObject private var store = Store<[Video]>()
|
||||
|
||||
@EnvironmentObject<AccountsModel> private var accounts
|
||||
|
||||
init(resource: Resource, label: String) {
|
||||
init(resource: Resource?, label: String) {
|
||||
self.resource = resource
|
||||
self.label = label
|
||||
}
|
||||
@@ -18,11 +18,11 @@ struct WatchNowSection: View {
|
||||
var body: some View {
|
||||
WatchNowSectionBody(label: label, videos: store.collection)
|
||||
.onAppear {
|
||||
resource.addObserver(store)
|
||||
resource.loadIfNeeded()
|
||||
resource?.addObserver(store)
|
||||
resource?.loadIfNeeded()
|
||||
}
|
||||
.onChange(of: accounts.current) { _ in
|
||||
resource.load()
|
||||
resource?.load()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user