Skip to content

Commit

Permalink
Add obsolete settings cleanup on save
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Tinland committed Jan 30, 2025
1 parent 320d07c commit 94eb794
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,7 @@ export function get() {
}

export async function set(newSettings) {
pruneObsoleteSettings(newSettings);
const settingsWithSchema = {
$schema:
"https://raw.githubusercontent.com/Jean-Tinland/simple-bar/refs/heads/master/lib/schemas/config.json",
Expand Down Expand Up @@ -871,3 +872,9 @@ export async function checkIfConfigFileExists() {
}
return exists;
}

function pruneObsoleteSettings(settings) {
delete settings.global.externalConfigFile;
delete settings.widgets.dndWidget;
delete settings.widgets.undefined;
}

0 comments on commit 94eb794

Please sign in to comment.