mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 05:02:53 +00:00
Show mini player sheets already requested when the root appears
The root view mirrors the coordinator's mini-player queue and playlist sheet flags into local state on change only, so a flag set before the view first appeared was never shown. Read the initial value too. Also remove the iOS Settings sheet driven by the .showSettings notification, which nothing posts.
This commit is contained in:
@@ -256,10 +256,10 @@ struct iOS18AdaptiveTabView: View {
|
||||
ExpandedPlayerWindowManager.shared.hide()
|
||||
}
|
||||
}
|
||||
.onChange(of: appEnvironment.navigationCoordinator.isMiniPlayerQueueSheetPresented) { _, newValue in
|
||||
.onChange(of: appEnvironment.navigationCoordinator.isMiniPlayerQueueSheetPresented, initial: true) { _, newValue in
|
||||
showingMiniPlayerQueueSheet = newValue
|
||||
}
|
||||
.onChange(of: appEnvironment.navigationCoordinator.isMiniPlayerPlaylistSheetPresented) { _, newValue in
|
||||
.onChange(of: appEnvironment.navigationCoordinator.isMiniPlayerPlaylistSheetPresented, initial: true) { _, newValue in
|
||||
showingMiniPlayerPlaylistSheet = newValue
|
||||
}
|
||||
.sheet(isPresented: $showingMiniPlayerQueueSheet, onDismiss: {
|
||||
@@ -386,10 +386,10 @@ struct iOS26AdaptiveTabView: View {
|
||||
ExpandedPlayerWindowManager.shared.hide()
|
||||
}
|
||||
}
|
||||
.onChange(of: appEnvironment.navigationCoordinator.isMiniPlayerQueueSheetPresented) { _, newValue in
|
||||
.onChange(of: appEnvironment.navigationCoordinator.isMiniPlayerQueueSheetPresented, initial: true) { _, newValue in
|
||||
showingMiniPlayerQueueSheet = newValue
|
||||
}
|
||||
.onChange(of: appEnvironment.navigationCoordinator.isMiniPlayerPlaylistSheetPresented) { _, newValue in
|
||||
.onChange(of: appEnvironment.navigationCoordinator.isMiniPlayerPlaylistSheetPresented, initial: true) { _, newValue in
|
||||
showingMiniPlayerPlaylistSheet = newValue
|
||||
}
|
||||
.sheet(isPresented: $showingMiniPlayerQueueSheet, onDismiss: {
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import Foundation
|
||||
|
||||
extension Notification.Name {
|
||||
static let showSettings = Notification.Name("showSettings")
|
||||
static let showOpenLinkSheet = Notification.Name("showOpenLinkSheet")
|
||||
static let openDescriptionLink = Notification.Name("openDescriptionLink")
|
||||
/// Posted when a URL shortener (bit.ly, etc.) has been resolved to an
|
||||
|
||||
@@ -51,9 +51,6 @@ struct YatteeApp: App {
|
||||
@State private var showingICloudProgress = false
|
||||
@State private var showingLegacyAccountsAlert = false
|
||||
@State private var showingLegacyAccountsImport = false
|
||||
#if os(iOS)
|
||||
@State private var showingSettings = false
|
||||
#endif
|
||||
@State private var showingOpenLinkSheet = false
|
||||
|
||||
// Ambiguous-link prompts are stored on NavigationCoordinator so they can
|
||||
@@ -221,23 +218,12 @@ struct YatteeApp: App {
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#if os(iOS)
|
||||
.sheet(isPresented: $showingSettings) {
|
||||
SettingsView()
|
||||
.appEnvironment(appEnvironment)
|
||||
}
|
||||
#endif
|
||||
#if !os(tvOS)
|
||||
.sheet(isPresented: $showingOpenLinkSheet) {
|
||||
OpenLinkSheet()
|
||||
.appEnvironment(appEnvironment)
|
||||
}
|
||||
#endif
|
||||
#if os(iOS)
|
||||
.onReceive(NotificationCenter.default.publisher(for: .showSettings)) { _ in
|
||||
showingSettings = true
|
||||
}
|
||||
#endif
|
||||
.onReceive(NotificationCenter.default.publisher(for: .showOpenLinkSheet)) { _ in
|
||||
appEnvironment.navigationCoordinator.isPlayerExpanded = false
|
||||
showingOpenLinkSheet = true
|
||||
|
||||
Reference in New Issue
Block a user