mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-24 04:03:03 -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)
|
.windowStyle(.titleBar)
|
||||||
.commandsRemoved()
|
.commandsRemoved()
|
||||||
.defaultSize(width: 320, height: 400)
|
.defaultSize(width: 320, height: 400)
|
||||||
|
.restorationBehaviourDisabled()
|
||||||
|
|
||||||
Window("", id: "donation-thank-you") {
|
Window("", id: "donation-thank-you") {
|
||||||
PaymentResultPopUp(state: .thankYou)
|
PaymentResultPopUp(state: .thankYou)
|
||||||
@ -139,6 +140,7 @@ struct Kiwix: App {
|
|||||||
.windowResizability(.contentMinSize)
|
.windowResizability(.contentMinSize)
|
||||||
.commandsRemoved()
|
.commandsRemoved()
|
||||||
.defaultSize(width: 320, height: 198)
|
.defaultSize(width: 320, height: 198)
|
||||||
|
.restorationBehaviourDisabled()
|
||||||
|
|
||||||
Window("", id: "donation-error") {
|
Window("", id: "donation-error") {
|
||||||
PaymentResultPopUp(state: .error)
|
PaymentResultPopUp(state: .error)
|
||||||
@ -147,6 +149,7 @@ struct Kiwix: App {
|
|||||||
.windowResizability(.contentMinSize)
|
.windowResizability(.contentMinSize)
|
||||||
.commandsRemoved()
|
.commandsRemoved()
|
||||||
.defaultSize(width: 320, height: 198)
|
.defaultSize(width: 320, height: 198)
|
||||||
|
.restorationBehaviourDisabled()
|
||||||
}
|
}
|
||||||
|
|
||||||
private func closeDonation() {
|
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 {
|
struct RootView: View {
|
||||||
@Environment(\.openWindow) var openWindow
|
@Environment(\.openWindow) var openWindow
|
||||||
@Environment(\.controlActiveState) var controlActiveState
|
@Environment(\.controlActiveState) var controlActiveState
|
||||||
|
Loading…
x
Reference in New Issue
Block a user