1
1
mirror of https://github.com/bitgapp/eqMac.git synced 2024-11-26 07:57:13 +03:00

skipping update check if cannot access internet

This commit is contained in:
Nodeful 2021-04-05 00:07:01 +03:00
parent 32c59090dc
commit 36549aac43
2 changed files with 8 additions and 1 deletions

View File

@ -17,14 +17,19 @@ class AppDelegate: NSObject, NSApplicationDelegate, SUUpdaterDelegate {
var updater = SUUpdater(for: Bundle.main)!
var updateProcessed = EmitterKit.Event<Void>()
var willBeDownloadingUpdate = false
var applicationStarted = false
func applicationDidFinishLaunching(_ aNotification: Notification) {
NSApplication.shared.windows.first?.close()
updater.delegate = self
updateProcessed.once { _ in
self.applicationStarted = true
Application.start()
}
updater.checkForUpdatesInBackground()
Utilities.delay(2000) {
self.updateProcessed.emit()
}
}
func applicationWillTerminate(_ aNotification: Notification) {

View File

@ -34,7 +34,9 @@ class InputSource {
static func requestPermission (_ callback: @escaping (Bool) -> Void) {
if #available(OSX 10.14, *) {
AVCaptureDevice.requestAccess(for: AVMediaType.audio, completionHandler: callback)
AVCaptureDevice.requestAccess(for: AVMediaType.audio) { granted in
callback(granted)
}
} else {
callback(true)
}