patch link open
This commit is contained in:
parent
1269a29ae8
commit
1e61409501
@ -62,8 +62,9 @@ final class AppUpdateChecker: ObservableObject {
|
|||||||
softUpdateNotice = nil
|
softUpdateNotice = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func openAppStore() {
|
func openAppStore(link overrideURL: URL? = nil) {
|
||||||
guard let url = needUpdateNotice?.appStoreURL
|
guard let url = overrideURL
|
||||||
|
?? needUpdateNotice?.appStoreURL
|
||||||
?? forceUpdateNotice?.appStoreURL
|
?? forceUpdateNotice?.appStoreURL
|
||||||
?? softUpdateNotice?.appStoreURL else {
|
?? softUpdateNotice?.appStoreURL else {
|
||||||
return
|
return
|
||||||
|
|||||||
@ -26,7 +26,7 @@ struct yobbleApp: App {
|
|||||||
NeedUpdateView(
|
NeedUpdateView(
|
||||||
title: notice.title,
|
title: notice.title,
|
||||||
message: notice.message,
|
message: notice.message,
|
||||||
onUpdate: { updateChecker.openAppStore() }
|
onUpdate: { updateChecker.openAppStore(link: notice.appStoreURL) }
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
ZStack(alignment: .top) {
|
ZStack(alignment: .top) {
|
||||||
@ -80,7 +80,7 @@ struct yobbleApp: App {
|
|||||||
title: Text(notice.title),
|
title: Text(notice.title),
|
||||||
message: Text(notice.message),
|
message: Text(notice.message),
|
||||||
primaryButton: .default(Text(NSLocalizedString("Обновить", comment: ""))) {
|
primaryButton: .default(Text(NSLocalizedString("Обновить", comment: ""))) {
|
||||||
updateChecker.openAppStore()
|
updateChecker.openAppStore(link: notice.appStoreURL)
|
||||||
},
|
},
|
||||||
secondaryButton: .cancel(Text(NSLocalizedString("Позже", comment: ""))) {
|
secondaryButton: .cancel(Text(NSLocalizedString("Позже", comment: ""))) {
|
||||||
updateChecker.dismissSoftUpdateIfNeeded()
|
updateChecker.dismissSoftUpdateIfNeeded()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user