Replace sheets with navigation destinations on tvOS

This commit is contained in:
世界
2025-12-02 13:53:07 +08:00
parent b3714ed957
commit e9d6b380bf
4 changed files with 174 additions and 3 deletions
@@ -35,9 +35,24 @@ public struct DashboardView: View {
.onChangeCompat(of: importRemoteProfile.wrappedValue) { _ in
handleImportRemoteProfile()
}
#if os(tvOS)
.navigationDestination(item: $importRemoteProfileRequest) { request in
NewProfileView(request)
.environmentObject(environments)
.onDisappear {
environments.profileUpdate.send()
}
.toolbar {
ToolbarItemGroup(placement: .topBarLeading) {
BackButton()
}
}
}
#else
.sheet(item: $importRemoteProfileRequest) { request in
importRemoteProfileSheet(for: request)
}
#endif
#if os(macOS)
.onChangeCompat(of: controlActiveState) { state in
guard state != .inactive, Variant.useSystemExtension, !coordinator.isLoading else { return }