mirror of
https://github.com/yattee/yattee.git
synced 2025-10-10 17:38:15 +00:00
Favorites improvements
This commit is contained in:
@@ -15,13 +15,6 @@ struct OpenURLHandler {
|
||||
var navigationStyle = NavigationStyle.sidebar
|
||||
|
||||
func handle(_ url: URL) {
|
||||
if Self.firstHandle {
|
||||
Self.firstHandle = false
|
||||
|
||||
Delay.by(1) { Self.shared.handle(url) }
|
||||
return
|
||||
}
|
||||
|
||||
if accounts.current.isNil {
|
||||
accounts.setCurrent(accounts.any)
|
||||
}
|
||||
@@ -52,27 +45,27 @@ struct OpenURLHandler {
|
||||
case .search:
|
||||
handleSearchUrlOpen(parser)
|
||||
case .favorites:
|
||||
hideViewsAboveBrowser()
|
||||
navigation.hideViewsAboveBrowser()
|
||||
navigation.tabSelection = .home
|
||||
#if os(macOS)
|
||||
focusMainWindow()
|
||||
#endif
|
||||
case .subscriptions:
|
||||
guard accounts.app.supportsSubscriptions, accounts.signedIn else { return }
|
||||
hideViewsAboveBrowser()
|
||||
navigation.hideViewsAboveBrowser()
|
||||
navigation.tabSelection = .subscriptions
|
||||
#if os(macOS)
|
||||
focusMainWindow()
|
||||
#endif
|
||||
case .popular:
|
||||
guard accounts.app.supportsPopular else { return }
|
||||
hideViewsAboveBrowser()
|
||||
navigation.hideViewsAboveBrowser()
|
||||
navigation.tabSelection = .popular
|
||||
#if os(macOS)
|
||||
focusMainWindow()
|
||||
#endif
|
||||
case .trending:
|
||||
hideViewsAboveBrowser()
|
||||
navigation.hideViewsAboveBrowser()
|
||||
navigation.tabSelection = .trending
|
||||
#if os(macOS)
|
||||
focusMainWindow()
|
||||
@@ -86,13 +79,6 @@ struct OpenURLHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private func hideViewsAboveBrowser() {
|
||||
player.hide()
|
||||
navigation.presentingChannel = false
|
||||
navigation.presentingPlaylist = false
|
||||
navigation.presentingOpenVideos = false
|
||||
}
|
||||
|
||||
private func handleFileURLOpen(_ parser: URLParser) {
|
||||
guard let url = parser.fileURL else { return }
|
||||
|
||||
|
Reference in New Issue
Block a user