mirror of
https://github.com/yattee/yattee.git
synced 2025-10-18 13:28:12 +00:00
Add Piped support
This commit is contained in:
@@ -8,7 +8,7 @@ struct WatchNowSection: View {
|
||||
|
||||
@StateObject private var store = Store<[Video]>()
|
||||
|
||||
@EnvironmentObject<InvidiousAPI> private var api
|
||||
@EnvironmentObject<AccountsModel> private var accounts
|
||||
|
||||
init(resource: Resource, label: String) {
|
||||
self.resource = resource
|
||||
@@ -21,7 +21,7 @@ struct WatchNowSection: View {
|
||||
resource.addObserver(store)
|
||||
resource.loadIfNeeded()
|
||||
}
|
||||
.onChange(of: api.account) { _ in
|
||||
.onChange(of: accounts.account) { _ in
|
||||
resource.load()
|
||||
}
|
||||
}
|
||||
|
@@ -3,12 +3,16 @@ import Siesta
|
||||
import SwiftUI
|
||||
|
||||
struct WatchNowView: View {
|
||||
@EnvironmentObject<InvidiousAPI> private var api
|
||||
@EnvironmentObject<AccountsModel> private var accounts
|
||||
|
||||
var api: InvidiousAPI! {
|
||||
accounts.invidious
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
PlayerControlsView {
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
if api.validInstance {
|
||||
if !accounts.account.isNil {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
if api.signedIn {
|
||||
WatchNowSection(resource: api.feed, label: "Subscriptions")
|
||||
|
Reference in New Issue
Block a user