mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-21 20:45:51 +03:00
Add computed property to FileProviderConfig to get and set internal config
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
1fc6014230
commit
f987bcd97a
1 changed files with 15 additions and 0 deletions
|
@ -15,4 +15,19 @@ struct FileProviderConfig {
|
|||
|
||||
let domainIdentifier: NSFileProviderDomainIdentifier
|
||||
|
||||
private var internalConfig: [String: Any] {
|
||||
get {
|
||||
let defaults = UserDefaults.standard
|
||||
if let settings = defaults.dictionary(forKey: domainIdentifier.rawValue) {
|
||||
return settings
|
||||
}
|
||||
let dictionary: [String: Any] = [:]
|
||||
defaults.setValue(dictionary, forKey: domainIdentifier.rawValue)
|
||||
return dictionary
|
||||
}
|
||||
set {
|
||||
let defaults = UserDefaults.standard
|
||||
defaults.setValue(newValue, forKey: domainIdentifier.rawValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue