refactor(zenThemesImporter): renamed disabled to enabled

- remove dom elements on enabled = false
This commit is contained in:
Bryan Galdámez 2024-09-14 14:32:54 -06:00
parent 4d8d109e78
commit 304b688473

View file

@ -12,7 +12,7 @@ var gZenStylesheetManager = {
async writeStylesheet(path, themes) {
let content = kZenStylesheetThemeHeader;
for (let theme of themes) {
if (theme.disabled) {
if (!theme.enabled) {
continue;
}
content += this.getThemeCSS(theme);
@ -147,6 +147,16 @@ var gZenThemeImporter = new (class {
for (const theme of Object.values(await this.getThemes())) {
const { preferences, areOldPreferences } = await this._getThemePreferences(theme);
if (!theme.enabled) {
const element = browser.document.getElementById(theme.name);
if (element) {
element.remove()
}
continue;
}
if (areOldPreferences) {
continue;
}