mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-22 02:52:39 -04:00
Remove restoration from donation windows
This commit is contained in:
parent
12d1c8f56e
commit
657d5b2379
@ -131,6 +131,7 @@ struct Kiwix: App {
|
||||
.windowStyle(.titleBar)
|
||||
.commandsRemoved()
|
||||
.defaultSize(width: 320, height: 400)
|
||||
.restorationBehaviourDisabled()
|
||||
|
||||
Window("", id: "donation-thank-you") {
|
||||
PaymentResultPopUp(state: .thankYou)
|
||||
@ -139,6 +140,7 @@ struct Kiwix: App {
|
||||
.windowResizability(.contentMinSize)
|
||||
.commandsRemoved()
|
||||
.defaultSize(width: 320, height: 198)
|
||||
.restorationBehaviourDisabled()
|
||||
|
||||
Window("", id: "donation-error") {
|
||||
PaymentResultPopUp(state: .error)
|
||||
@ -147,6 +149,7 @@ struct Kiwix: App {
|
||||
.windowResizability(.contentMinSize)
|
||||
.commandsRemoved()
|
||||
.defaultSize(width: 320, height: 198)
|
||||
.restorationBehaviourDisabled()
|
||||
}
|
||||
|
||||
private func closeDonation() {
|
||||
@ -175,6 +178,16 @@ struct Kiwix: App {
|
||||
}
|
||||
}
|
||||
|
||||
private extension Scene {
|
||||
nonisolated func restorationBehaviourDisabled() -> some Scene {
|
||||
if #available(macOS 15.0, *) {
|
||||
return restorationBehavior(.disabled)
|
||||
} else {
|
||||
return self
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct RootView: View {
|
||||
@Environment(\.openWindow) var openWindow
|
||||
@Environment(\.controlActiveState) var controlActiveState
|
||||
|
Loading…
x
Reference in New Issue
Block a user