0
0
Fork 0

fix: Save settings when they are changed, not just on unload

This commit is contained in:
Oliver Akins 2022-05-27 18:14:12 -06:00
parent 71bf870199
commit eeb701d1e5
No known key found for this signature in database
GPG key ID: 3C2014AF9457AF99

View file

@ -48,6 +48,7 @@ export default class FileHider extends Plugin {
let rule = createStyleLine(`folder`, file.path); let rule = createStyleLine(`folder`, file.path);
this.style.insertRule(rule); this.style.insertRule(rule);
this.settings.hiddenFolders.push(file.path); this.settings.hiddenFolders.push(file.path);
this.saveSettings();
}); });
}; };
}); });
@ -66,6 +67,7 @@ export default class FileHider extends Plugin {
let rule = createStyleLine(`file`, file.path); let rule = createStyleLine(`file`, file.path);
this.style.insertRule(rule); this.style.insertRule(rule);
this.settings.hiddenFiles.push(file.path); this.settings.hiddenFiles.push(file.path);
this.saveSettings();
}); });
}; };
}); });
@ -128,6 +130,7 @@ export default class FileHider extends Plugin {
this.style.disabled = false; this.style.disabled = false;
}; };
this.settings.hidden = !this.settings.hidden; this.settings.hidden = !this.settings.hidden;
this.saveSettings();
}; };
unhideFolder(folder: string) { unhideFolder(folder: string) {
@ -141,6 +144,7 @@ export default class FileHider extends Plugin {
this.style.deleteRule(parseInt(j)); this.style.deleteRule(parseInt(j));
}; };
}; };
this.saveSettings();
}; };
unhideFile(file: string) { unhideFile(file: string) {
@ -157,6 +161,7 @@ export default class FileHider extends Plugin {
break; break;
}; };
}; };
this.saveSettings();
} }
}; };