LMMgr // Fix logical errors with external factory dict path.

This commit is contained in:
ShikiSuen 2023-12-02 14:46:10 +08:00
parent 8a634a9abd
commit 36fcff6614
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ public extension LMMgr {
guard let factoryResultURL = Bundle.main.url(forResource: "vChewingFactoryDatabase", withExtension: "sqlite") else { guard let factoryResultURL = Bundle.main.url(forResource: "vChewingFactoryDatabase", withExtension: "sqlite") else {
return nil return nil
} }
guard !factory, !PrefMgr.shared.useExternalFactoryDict else { return factoryResultURL.path } guard !factory, PrefMgr.shared.useExternalFactoryDict else { return factoryResultURL.path }
let containerResultURL = Self.appSupportURL.appendingPathComponent("vChewingFactoryData/vChewingFactoryDatabase.sqlite") let containerResultURL = Self.appSupportURL.appendingPathComponent("vChewingFactoryData/vChewingFactoryDatabase.sqlite")
return FileManager.default.fileExists(atPath: containerResultURL.path, isDirectory: nil) ? containerResultURL.path : factoryResultURL.path return FileManager.default.fileExists(atPath: containerResultURL.path, isDirectory: nil) ? containerResultURL.path : factoryResultURL.path
} }