From 3d98e6d9740d378ed51b8d7a50c40a467dcd431c Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 28 Aug 2023 21:11:24 +0800 Subject: [PATCH] AppDelegate // Shift certain boot tasks for macOS 14 compatibility. --- .../Sources/MainAssembly/AppDelegate.swift | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Packages/vChewing_MainAssembly/Sources/MainAssembly/AppDelegate.swift b/Packages/vChewing_MainAssembly/Sources/MainAssembly/AppDelegate.swift index d3bf04ab..d590ec5a 100644 --- a/Packages/vChewing_MainAssembly/Sources/MainAssembly/AppDelegate.swift +++ b/Packages/vChewing_MainAssembly/Sources/MainAssembly/AppDelegate.swift @@ -61,7 +61,7 @@ public extension AppDelegate { true } - func applicationDidFinishLaunching(_: Notification) { + func applicationWillFinishLaunching(_: Notification) { NSUserNotificationCenter.default.delegate = self PrefMgr.shared.fixOddPreferences() @@ -82,14 +82,12 @@ public extension AppDelegate { } if !PrefMgr.shared.onlyLoadFactoryLangModelsIfNeeded { LMMgr.loadDataModelsOnAppDelegate() } - DispatchQueue.main.async { - LMMgr.loadCassetteData() - LMMgr.initUserLangModels() - self.folderMonitor.folderDidChange = { [weak self] in - self?.reloadOnFolderChangeHappens() - } - if LMMgr.userDataFolderExists { self.folderMonitor.startMonitoring() } + LMMgr.loadCassetteData() + LMMgr.initUserLangModels() + folderMonitor.folderDidChange = { [weak self] in + self?.reloadOnFolderChangeHappens() } + if LMMgr.userDataFolderExists { folderMonitor.startMonitoring() } // 只要使用者沒有勾選檢查更新、沒有主動做出要檢查更新的操作,就不要檢查更新。 if PrefMgr.shared.checkUpdateAutomatically {