patch link open

This commit is contained in:
cheykrym 2025-12-18 07:52:56 +03:00
parent 1269a29ae8
commit 1e61409501
2 changed files with 10 additions and 9 deletions

View File

@ -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

View File

@ -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()
}