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