mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Fix manage object context in tvOS info view controllers
This commit is contained in:
parent
e159bb772c
commit
792db567ed
@ -10,6 +10,8 @@ final class PlayerViewController: UIViewController {
|
|||||||
var subscriptionsModel: SubscriptionsModel!
|
var subscriptionsModel: SubscriptionsModel!
|
||||||
var playerView = AVPlayerViewController()
|
var playerView = AVPlayerViewController()
|
||||||
|
|
||||||
|
let persistenceController = PersistenceController.shared
|
||||||
|
|
||||||
#if !os(tvOS)
|
#if !os(tvOS)
|
||||||
var aspectRatio: Double? {
|
var aspectRatio: Double? {
|
||||||
let ratio = Double(playerView.videoBounds.width) / Double(playerView.videoBounds.height)
|
let ratio = Double(playerView.videoBounds.width) / Double(playerView.videoBounds.height)
|
||||||
@ -95,6 +97,7 @@ final class PlayerViewController: UIViewController {
|
|||||||
.environmentObject(commentsModel)
|
.environmentObject(commentsModel)
|
||||||
.environmentObject(playerModel)
|
.environmentObject(playerModel)
|
||||||
.environmentObject(subscriptionsModel)
|
.environmentObject(subscriptionsModel)
|
||||||
|
.environment(\.managedObjectContext, persistenceController.container.viewContext)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ struct TVNavigationView: View {
|
|||||||
@EnvironmentObject<RecentsModel> private var recents
|
@EnvironmentObject<RecentsModel> private var recents
|
||||||
|
|
||||||
@Default(.visibleSections) private var visibleSections
|
@Default(.visibleSections) private var visibleSections
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
TabView(selection: navigation.tabSelectionBinding) {
|
TabView(selection: navigation.tabSelectionBinding) {
|
||||||
if visibleSections.contains(.favorites) {
|
if visibleSections.contains(.favorites) {
|
||||||
|
Loading…
Reference in New Issue
Block a user