Repo // Stop using didSet in cassettePath property.

- It doesn't work in some cases.
This commit is contained in:
ShikiSuen 2022-10-24 11:31:22 +08:00
parent 96e530fa01
commit 3ca7410316
3 changed files with 3 additions and 5 deletions

View File

@ -38,11 +38,7 @@ public class PrefMgr: PrefMgrProtocol {
public var checkUpdateAutomatically: Bool
@AppProperty(key: UserDef.kCassettePath.rawValue, defaultValue: "")
public var cassettePath: String {
didSet {
LMMgr.loadCassetteData()
}
}
public var cassettePath: String
@AppProperty(key: UserDef.kUserDataFolderSpecified.rawValue, defaultValue: "")
public var userDataFolderSpecified: String

View File

@ -76,6 +76,7 @@ struct VwrPrefPaneCassette: View {
guard let url = Self.dlgOpenFile.url else { return }
if LMMgr.checkCassettePathValidity(url.path) {
PrefMgr.shared.cassettePath = url.path
LMMgr.loadCassetteData()
tbxCassettePath = PrefMgr.shared.cassettePath
BookmarkManager.shared.saveBookmark(for: url)
} else {

View File

@ -324,6 +324,7 @@ class CtlPrefWindow: NSWindowController {
guard let url = dlgOpenFile.url else { return }
if LMMgr.checkCassettePathValidity(url.path) {
PrefMgr.shared.cassettePath = url.path
LMMgr.loadCassetteData()
BookmarkManager.shared.saveBookmark(for: url)
} else {
IMEApp.buzz()