Update GUI state in resetToDefaults
suppressReload was eating the file-watch callback that would have called loadConfig and refreshed the draft from disk, so the GUI stayed on the pre-reset layout even though bar.json was already correct. Apply the reset payload directly to draft (and bump draftRevision) so section editors re-render in the same frame.
This commit is contained in:
@@ -151,6 +151,10 @@ ShellRoot {
|
|||||||
fontFamily: String(source.fontFamily || "JetBrainsMono Nerd Font"),
|
fontFamily: String(source.fontFamily || "JetBrainsMono Nerd Font"),
|
||||||
layout: normalizeLayout(source.layout || {})
|
layout: normalizeLayout(source.layout || {})
|
||||||
}
|
}
|
||||||
|
// Update the GUI synchronously — the suppressed file-watch callback won't
|
||||||
|
// fire loadConfig, so the draft would otherwise stay stale.
|
||||||
|
draft = payload
|
||||||
|
draftRevision++
|
||||||
suppressReload = true
|
suppressReload = true
|
||||||
userFile.setText(JSON.stringify(payload, null, 2) + "\n")
|
userFile.setText(JSON.stringify(payload, null, 2) + "\n")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user