From 02e66e45200dca5146571cf7f2431f43c74ee3c5 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Fri, 17 Dec 2021 20:58:24 +0100 Subject: [PATCH] Fix tab navigation environment objects --- Shared/Navigation/AppTabNavigation.swift | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Shared/Navigation/AppTabNavigation.swift b/Shared/Navigation/AppTabNavigation.swift index 026553fc..273aea20 100644 --- a/Shared/Navigation/AppTabNavigation.swift +++ b/Shared/Navigation/AppTabNavigation.swift @@ -52,6 +52,12 @@ struct AppTabNavigation: View { ChannelVideosView(channel: channel) .environment(\.inChannelView, true) .environment(\.inNavigationView, true) + .environmentObject(accounts) + .environmentObject(navigation) + .environmentObject(player) + .environmentObject(subscriptions) + .environmentObject(thumbnailsModel) + .background(playerNavigationLink) } } @@ -67,7 +73,12 @@ struct AppTabNavigation: View { NavigationView { ChannelPlaylistView(playlist: playlist) .environment(\.inNavigationView, true) + .environmentObject(accounts) + .environmentObject(navigation) + .environmentObject(player) .environmentObject(subscriptions) + .environmentObject(thumbnailsModel) + .background(playerNavigationLink) } } @@ -76,7 +87,7 @@ struct AppTabNavigation: View { .background( EmptyView().fullScreenCover(isPresented: $player.presentingPlayer) { videoPlayer - .environment(\.navigationStyle, .sidebar) + .environment(\.navigationStyle, .tab) } ) } @@ -160,7 +171,7 @@ struct AppTabNavigation: View { private var playerNavigationLink: some View { NavigationLink(isActive: $player.playerNavigationLinkActive, destination: { - VideoPlayerView() + videoPlayer .environment(\.inNavigationView, true) }) { EmptyView()