forked from shadowfacts/Tusker
Use App Group for user defaults
This commit is contained in:
parent
b2c7735256
commit
7f0fd119c5
|
@ -30,7 +30,20 @@ class LocalData: ObservableObject {
|
|||
]
|
||||
}
|
||||
} else {
|
||||
defaults = UserDefaults()
|
||||
defaults = UserDefaults(suiteName: "group.space.vaccor.Tusker")!
|
||||
tryMigrateOldDefaults()
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: remove me before public beta
|
||||
private func tryMigrateOldDefaults() {
|
||||
let old = UserDefaults()
|
||||
if let accounts = old.array(forKey: accountsKey) as? [[String: String]],
|
||||
let mostRecentAccount = old.string(forKey: mostRecentAccountKey) {
|
||||
defaults.setValue(accounts, forKey: accountsKey)
|
||||
defaults.setValue(mostRecentAccount, forKey: mostRecentAccountKey)
|
||||
old.removeObject(forKey: accountsKey)
|
||||
old.removeObject(forKey: mostRecentAccountKey)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>group.space.vaccor.Tusker</string>
|
||||
</array>
|
||||
<key>com.apple.security.device.audio-input</key>
|
||||
<true/>
|
||||
<key>com.apple.security.device.camera</key>
|
||||
|
|
Loading…
Reference in New Issue