Skip to content

Commit

Permalink
Required changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Catta1997 committed Jul 18, 2024
1 parent 423cf1f commit 8e96272
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions PlayCover/Model/PlayApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class PlayApp: BaseApp {
public static let bundleIDCacheURL = PlayTools.playCoverContainer.appendingPathComponent("CACHE")
var displaySleepAssertionID: IOPMAssertionID?
public var isStarting = false

public static var bundleIDCache: [String] {
get throws {
(try String(contentsOf: bundleIDCacheURL)).split(whereSeparator: \.isNewline).map({ String($0) })
Expand All @@ -36,11 +35,11 @@ class PlayApp: BaseApp {
func launch() async {
do {
isStarting = true
let noMacAlert = UserDefaults.standard.bool(forKey: "\(info.bundleIdentifier).noMacAlert")
if prohibitedToPlay {
await clearAllCache()
throw PlayCoverError.appProhibited
} else if hasMacVersion, await !runMacOSWarning() {
await clearAllCache()
} else if hasMacVersion && !noMacAlert, await !runMacOSWarning() {
isStarting = false
return
} else if maliciousProhibited {
Expand Down
3 changes: 2 additions & 1 deletion PlayCover/Utils/Extensions/PlayAppExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ extension PlayApp {
alert.alertStyle = .warning
alert.addButton(withTitle: NSLocalizedString("alert.start.anyway", comment: ""))
alert.addButton(withTitle: NSLocalizedString("alert.open.appstore", comment: ""))
alert.addButton(withTitle: NSLocalizedString("alert.quit", comment: ""))
alert.addButton(withTitle: NSLocalizedString("button.Cancel", comment: ""))
let result = alert.runModal()
switch result {
case .alertFirstButtonReturn:
UserDefaults.standard.set(true, forKey: "\(info.bundleIdentifier).noMacAlert")
return true
case .alertSecondButtonReturn:
let urlString = "https://itunes.apple.com/lookup?bundleId=\(info.bundleIdentifier)"
Expand Down
3 changes: 1 addition & 2 deletions PlayCover/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -310,5 +310,4 @@

"macos.version" = "This app can be installed from Mac App Store";
"alert.start.anyway" = "Start Anyway";
"alert.quit" = "Quit";
"alert.open.appstore" = "Open AppStore";
"alert.open.appstore" = "Open Mac App Store";

0 comments on commit 8e96272

Please sign in to comment.