diff --git a/phpmon/Common/Core/Constants.swift b/phpmon/Common/Core/Constants.swift index 99c7a3e..8fbef99 100644 --- a/phpmon/Common/Core/Constants.swift +++ b/phpmon/Common/Core/Constants.swift @@ -86,6 +86,10 @@ struct Constants { string: "https://phpmon.app/builds/early-access/sponsors/phpmon-eap.rb" )! + static let EarlyAccessChangelog = URL( + string: "https://phpmon.app/early-access/release-notes" + )! + } } diff --git a/phpmon/Domain/App/AppUpdater.swift b/phpmon/Domain/App/AppUpdater.swift index 7a314d2..43b2fde 100644 --- a/phpmon/Domain/App/AppUpdater.swift +++ b/phpmon/Domain/App/AppUpdater.swift @@ -72,7 +72,7 @@ class AppUpdater { : "brew upgrade phpmon" Task { @MainActor in - var alert = BetterAlert().withInformation( + BetterAlert().withInformation( title: "updater.alerts.newer_version_available.title" .localized(latestVersionOnline.humanReadable), subtitle: "updater.alerts.newer_version_available.subtitle" @@ -89,21 +89,21 @@ class AppUpdater { vc.close(with: .OK) } ) - - if !App.identifier.contains(".phpmon.eap") { - alert = alert.withSecondary( - text: "updater.alerts.buttons.release_notes".localized, - action: { _ in - let urlSegments = self.caskFile.url.split(separator: "/") - let tag = urlSegments[urlSegments.count - 2] // ../download/{tag}/{file.zip} - NSWorkspace.shared.open( - Constants.Urls.GitHubReleases.appendingPathComponent("/tag/\(tag)") - ) - } - ) - } - - alert.withTertiary(text: "updater.alerts.buttons.dismiss".localized, action: { vc in + .withSecondary( + text: "updater.alerts.buttons.release_notes".localized, + action: { _ in + NSWorkspace.shared.open({ + if App.identifier.contains(".eap") { + return Constants.Urls.EarlyAccessChangelog + } else { + let urlSegments = self.caskFile.url.split(separator: "/") + let tag = urlSegments[urlSegments.count - 2] // ../download/{tag}/{file.zip} + return Constants.Urls.GitHubReleases.appendingPathComponent("/tag/\(tag)") + } + }()) + } + ) + .withTertiary(text: "updater.alerts.buttons.dismiss".localized, action: { vc in vc.close(with: .OK) }) .show()