mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Automatically open mail when fetching Anisette data and update error message to accomodate
This commit is contained in:
committed by
Joseph Mattello
parent
070cb6c873
commit
353d105c04
@@ -7,6 +7,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import AppKit
|
||||||
|
|
||||||
private extension Bundle
|
private extension Bundle
|
||||||
{
|
{
|
||||||
@@ -115,7 +116,14 @@ private extension AnisetteDataManager
|
|||||||
let requestUUID = UUID().uuidString
|
let requestUUID = UUID().uuidString
|
||||||
self.anisetteDataCompletionHandlers[requestUUID] = completion
|
self.anisetteDataCompletionHandlers[requestUUID] = completion
|
||||||
|
|
||||||
let timer = Timer(timeInterval: 1.0, repeats: false) { (timer) in
|
if let mailApp = FileManager.default.urls(
|
||||||
|
for: .applicationDirectory,
|
||||||
|
in: .systemDomainMask
|
||||||
|
).first?.appendingPathComponent("Mail.app") {
|
||||||
|
NSWorkspace.shared.open(mailApp)
|
||||||
|
}
|
||||||
|
|
||||||
|
let timer = Timer(timeInterval: 5.0, repeats: false) { (timer) in
|
||||||
self.finishRequest(forUUID: requestUUID, result: .failure(ALTServerError(.pluginNotFound)))
|
self.finishRequest(forUUID: requestUUID, result: .failure(ALTServerError(.pluginNotFound)))
|
||||||
}
|
}
|
||||||
self.anisetteDataTimers[requestUUID] = timer
|
self.anisetteDataTimers[requestUUID] = timer
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ NSErrorUserInfoKey const ALTOperatingSystemVersionErrorKey = @"ALTOperatingSyste
|
|||||||
return NSLocalizedString(@"Make sure you have trusted this device with your computer and Wi-Fi sync is enabled.", @"");
|
return NSLocalizedString(@"Make sure you have trusted this device with your computer and Wi-Fi sync is enabled.", @"");
|
||||||
|
|
||||||
case ALTServerErrorPluginNotFound:
|
case ALTServerErrorPluginNotFound:
|
||||||
return NSLocalizedString(@"Make sure Mail is running and the plug-in is enabled in Mail's preferences.", @"");
|
return NSLocalizedString(@"Mail has been automatically opened, try again in a moment. Otherwise, make sure plug-in is enabled in Mail's preferences.", @"");
|
||||||
|
|
||||||
case ALTServerErrorMaximumFreeAppLimitReached:
|
case ALTServerErrorMaximumFreeAppLimitReached:
|
||||||
#if TARGET_OS_OSX
|
#if TARGET_OS_OSX
|
||||||
|
|||||||
Reference in New Issue
Block a user