Minor fixes

This commit is contained in:
世界
2026-04-20 05:28:31 +08:00
parent 142e82034e
commit a09170256d
10 changed files with 69 additions and 61 deletions
@@ -193,15 +193,6 @@ public struct GlobalChecksModifier: ViewModifier {
}
#if os(tvOS)
var state = AlertState(
title: String(localized: "Deprecated Warning"),
message: report.message(),
dismissButton: .cancel(String(localized: "Ok"))
)
state.onDismiss = continueChain
alert = state
#else
if report.migrationLink.isEmpty {
var state = AlertState(
title: String(localized: "Deprecated Warning"),
message: report.message(),
@@ -209,17 +200,26 @@ public struct GlobalChecksModifier: ViewModifier {
)
state.onDismiss = continueChain
alert = state
} else {
alert = AlertState(
title: String(localized: "Deprecated Warning"),
message: report.message(),
primaryButton: .default(String(localized: "Documentation")) {
openURL(URL(string: report.migrationLink)!)
},
secondaryButton: .cancel(String(localized: "Ok")),
onDismiss: continueChain
)
}
#else
if report.migrationLink.isEmpty {
var state = AlertState(
title: String(localized: "Deprecated Warning"),
message: report.message(),
dismissButton: .cancel(String(localized: "Ok"))
)
state.onDismiss = continueChain
alert = state
} else {
alert = AlertState(
title: String(localized: "Deprecated Warning"),
message: report.message(),
primaryButton: .default(String(localized: "Documentation")) {
openURL(URL(string: report.migrationLink)!)
},
secondaryButton: .cancel(String(localized: "Ok")),
onDismiss: continueChain
)
}
#endif
}