From 97af5a6e0c9ac025e00c34a3c4d02ef5d2f99e94 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sun, 21 May 2023 14:01:33 +0200 Subject: [PATCH] Fix opening channels and playlists --- Shared/Channels/ChannelPlaylistView.swift | 5 +++-- Shared/Navigation/ContentView.swift | 2 +- Shared/OpenURLHandler.swift | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Shared/Channels/ChannelPlaylistView.swift b/Shared/Channels/ChannelPlaylistView.swift index c81ff916..c46df845 100644 --- a/Shared/Channels/ChannelPlaylistView.swift +++ b/Shared/Channels/ChannelPlaylistView.swift @@ -85,7 +85,6 @@ struct ChannelPlaylistView: View { } } #endif - #if os(macOS) .toolbar { ToolbarItem(placement: .cancellationAction) { if showCloseButton { @@ -97,7 +96,9 @@ struct ChannelPlaylistView: View { .buttonStyle(.plain) } } - + } + #if os(macOS) + .toolbar { ToolbarItem(placement: playlistButtonsPlacement) { HStack { ListingStyleButtons(listingStyle: $channelPlaylistListingStyle) diff --git a/Shared/Navigation/ContentView.swift b/Shared/Navigation/ContentView.swift index 15741fdc..89ef9649 100644 --- a/Shared/Navigation/ContentView.swift +++ b/Shared/Navigation/ContentView.swift @@ -102,7 +102,7 @@ struct ContentView: View { } .onOpenURL { url in URLBookmarkModel.shared.saveBookmark(url) - OpenURLHandler.shared.handle(url) + OpenURLHandler(navigationStyle: navigationStyle).handle(url) } .background( EmptyView().sheet(isPresented: $navigation.presentingAddToPlaylist) { diff --git a/Shared/OpenURLHandler.swift b/Shared/OpenURLHandler.swift index bfc4554b..9f1f9e20 100644 --- a/Shared/OpenURLHandler.swift +++ b/Shared/OpenURLHandler.swift @@ -4,7 +4,6 @@ import Siesta struct OpenURLHandler { static var firstHandle = true - static var shared = Self() static let yatteeProtocol = "yattee://" var accounts: AccountsModel { .shared } @@ -12,7 +11,7 @@ struct OpenURLHandler { var recents: RecentsModel { .shared } var player: PlayerModel { .shared } var search: SearchModel { .shared } - var navigationStyle = NavigationStyle.sidebar + var navigationStyle: NavigationStyle func handle(_ url: URL) { if accounts.current.isNil {