mirror of
https://github.com/yattee/yattee.git
synced 2025-10-10 01:18:16 +00:00
Subscriptions view
This commit is contained in:
@@ -16,6 +16,10 @@ struct PopularVideosView: View {
|
||||
}
|
||||
|
||||
var videos: [Video] {
|
||||
if (provider.videos.isEmpty) {
|
||||
provider.load()
|
||||
}
|
||||
|
||||
return provider.videos
|
||||
}
|
||||
}
|
||||
|
21
Apple TV/SubscriptionsView.swift
Normal file
21
Apple TV/SubscriptionsView.swift
Normal file
@@ -0,0 +1,21 @@
|
||||
import SwiftUI
|
||||
|
||||
struct SubscriptionsView: View {
|
||||
@ObservedObject private var provider = SubscriptionVideosProvider()
|
||||
@ObservedObject var state: AppState
|
||||
|
||||
@Binding var tabSelection: TabSelection
|
||||
|
||||
var body: some View {
|
||||
VideosView(state: state, tabSelection: $tabSelection, videos: videos)
|
||||
.task {
|
||||
async {
|
||||
provider.load()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var videos: [Video] {
|
||||
return provider.videos
|
||||
}
|
||||
}
|
@@ -8,7 +8,7 @@ struct VideosView: View {
|
||||
var videos: [Video]
|
||||
|
||||
var body: some View {
|
||||
Group {
|
||||
Section {
|
||||
List {
|
||||
ForEach(videos) { video in
|
||||
VideoThumbnailView(video: video)
|
||||
|
Reference in New Issue
Block a user