mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-19 17:54:01 -04:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user