File tree Expand file tree Collapse file tree 4 files changed +11
-4
lines changed
Core/Sources/Core/Configs Expand file tree Collapse file tree 4 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ protocol BoolConfigItem: ConfigItem<Bool> {
77extension BoolConfigItem {
88 public var value : Bool {
99 get {
10- if let value = UserDefaults . standard. value ( forKey: Self . key) {
10+ if let value = UserDefaults . standard. object ( forKey: Self . key) {
1111 value as? Bool ?? Self . default
1212 } else {
1313 Self . default
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ extension Config {
209209 public static var `default` : Value {
210210 // Migration: If user had OpenAI API enabled, preserve that setting
211211 let legacyKey = Config . Deprecated. EnableOpenAiApiKey. key
212- if let legacyValue = UserDefaults . standard. value ( forKey: legacyKey) as? Bool ,
212+ if let legacyValue = UserDefaults . standard. object ( forKey: legacyKey) as? Bool ,
213213 legacyValue {
214214 return . openAI
215215 }
Original file line number Diff line number Diff line change 11import Foundation
2+ #if canImport(UniformTypeIdentifiers)
3+ import UniformTypeIdentifiers
4+ #endif
25import KanaKanjiConverterModule
36
47public enum CustomInputTableStore {
@@ -15,7 +18,11 @@ public enum CustomInputTableStore {
1518 }
1619
1720 static var fileURL : URL {
18- directoryURL. appendingPathComponent ( fileName, conformingTo: . text)
21+ #if canImport(UniformTypeIdentifiers) && !os(Linux)
22+ return directoryURL. appendingPathComponent ( fileName, conformingTo: . text)
23+ #else
24+ return directoryURL. appendingPathComponent ( fileName)
25+ #endif
1926 }
2027
2128 @discardableResult
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ protocol IntConfigItem: ConfigItem<Int> {
77extension IntConfigItem {
88 public var value : Int {
99 get {
10- if let value = UserDefaults . standard. value ( forKey: Self . key) {
10+ if let value = UserDefaults . standard. object ( forKey: Self . key) {
1111 value as? Int ?? Self . default
1212 } else {
1313 Self . default
You can’t perform that action at this time.
0 commit comments