settings: skip unchanged saves so external edits are not swallowed (#3504)

saveSettings() set _selfWrite before setText(). When the serialized
settings were identical to the file, nothing was written, no
fileChanged followed, and the flag stayed set. The next external edit
of settings.json was then taken for our own write and never reloaded.

(cherry picked from commit 84594e6449)
This commit is contained in:
Satoshoe
2026-10-07 13:03:42 -04:00
committed by bbedward
parent 6eb9df87cf
commit 02ddd010a0
+4 -1
View File
@@ -1988,8 +1988,11 @@ Singleton {
function saveSettings() {
if (_loading || _parseError || !_hasLoaded)
return;
const json = JSON.stringify(Store.toJson(root), null, 2);
if (json === settingsFile.text())
return;
_selfWrite = true;
settingsFile.setText(JSON.stringify(Store.toJson(root), null, 2));
settingsFile.setText(json);
if (_isReadOnly)
_checkSettingsWritable();
}