Fix tab navigation environment objects

This commit is contained in:
Arkadiusz Fal 2021-12-17 20:58:24 +01:00
parent de09f9dd52
commit 02e66e4520

View File

@ -52,6 +52,12 @@ struct AppTabNavigation: View {
ChannelVideosView(channel: channel) ChannelVideosView(channel: channel)
.environment(\.inChannelView, true) .environment(\.inChannelView, true)
.environment(\.inNavigationView, true) .environment(\.inNavigationView, true)
.environmentObject(accounts)
.environmentObject(navigation)
.environmentObject(player)
.environmentObject(subscriptions)
.environmentObject(thumbnailsModel)
.background(playerNavigationLink) .background(playerNavigationLink)
} }
} }
@ -67,7 +73,12 @@ struct AppTabNavigation: View {
NavigationView { NavigationView {
ChannelPlaylistView(playlist: playlist) ChannelPlaylistView(playlist: playlist)
.environment(\.inNavigationView, true) .environment(\.inNavigationView, true)
.environmentObject(accounts)
.environmentObject(navigation)
.environmentObject(player)
.environmentObject(subscriptions) .environmentObject(subscriptions)
.environmentObject(thumbnailsModel)
.background(playerNavigationLink) .background(playerNavigationLink)
} }
} }
@ -76,7 +87,7 @@ struct AppTabNavigation: View {
.background( .background(
EmptyView().fullScreenCover(isPresented: $player.presentingPlayer) { EmptyView().fullScreenCover(isPresented: $player.presentingPlayer) {
videoPlayer videoPlayer
.environment(\.navigationStyle, .sidebar) .environment(\.navigationStyle, .tab)
} }
) )
} }
@ -160,7 +171,7 @@ struct AppTabNavigation: View {
private var playerNavigationLink: some View { private var playerNavigationLink: some View {
NavigationLink(isActive: $player.playerNavigationLinkActive, destination: { NavigationLink(isActive: $player.playerNavigationLinkActive, destination: {
VideoPlayerView() videoPlayer
.environment(\.inNavigationView, true) .environment(\.inNavigationView, true)
}) { }) {
EmptyView() EmptyView()