mirror of
https://github.com/yattee/yattee.git
synced 2026-07-19 05:42:04 +00:00
Skip local-only settings keys when enabling iCloud settings sync
refreshFromiCloud already skipped isLocalOnly keys, but the enable-time paths did not: replaceWithiCloudData overwrote device-specific settings with another device's values, and syncToiCloud uploaded local-only keys to the ubiquitous store. Apply the same skip in both.
This commit is contained in:
@@ -335,6 +335,11 @@ extension SettingsManager {
|
||||
|
||||
// Copy all local settings to iCloud
|
||||
for key in SettingsKey.allCases {
|
||||
// Skip local-only keys (device-specific settings that shouldn't sync)
|
||||
if key.isLocalOnly {
|
||||
continue
|
||||
}
|
||||
|
||||
let pKey = platformKey(key)
|
||||
if let value = localDefaults.object(forKey: pKey) {
|
||||
ubiquitousStore.set(value, forKey: pKey)
|
||||
@@ -362,6 +367,11 @@ extension SettingsManager {
|
||||
|
||||
// Copy all iCloud settings to local defaults
|
||||
for key in SettingsKey.allCases {
|
||||
// Skip local-only keys (device-specific settings that shouldn't sync)
|
||||
if key.isLocalOnly {
|
||||
continue
|
||||
}
|
||||
|
||||
// Skip protected keys that should preserve local values
|
||||
if keysToPreserve.contains(key) {
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user