fix(macOS): keep gateway config sync local
This commit is contained in:
@@ -416,7 +416,8 @@ final class AppState {
|
|||||||
: nil
|
: nil
|
||||||
|
|
||||||
Task { @MainActor in
|
Task { @MainActor in
|
||||||
var root = await ConfigStore.load()
|
// Keep app-only connection settings local to avoid overwriting remote gateway config.
|
||||||
|
var root = ClawdbotConfigFile.loadDict()
|
||||||
var gateway = root["gateway"] as? [String: Any] ?? [:]
|
var gateway = root["gateway"] as? [String: Any] ?? [:]
|
||||||
var changed = false
|
var changed = false
|
||||||
|
|
||||||
@@ -446,8 +447,12 @@ final class AppState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
guard changed else { return }
|
guard changed else { return }
|
||||||
root["gateway"] = gateway
|
if gateway.isEmpty {
|
||||||
try? await ConfigStore.save(root)
|
root.removeValue(forKey: "gateway")
|
||||||
|
} else {
|
||||||
|
root["gateway"] = gateway
|
||||||
|
}
|
||||||
|
ClawdbotConfigFile.saveDict(root)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user