From 66e0dde1eda98bcbda4bde6c5ad88fd447f798aa Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Tue, 13 May 2025 13:38:47 +0200 Subject: [PATCH] fix: Make sure to remove the stylesheets before removing the file, b=(no-bug), c=mods --- src/zen/mods/ZenThemesImporter.mjs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/zen/mods/ZenThemesImporter.mjs b/src/zen/mods/ZenThemesImporter.mjs index e1378a564..65bd00888 100644 --- a/src/zen/mods/ZenThemesImporter.mjs +++ b/src/zen/mods/ZenThemesImporter.mjs @@ -149,12 +149,10 @@ var gZenThemesImporter = new (class { async removeStylesheet() { await this.sss.unregisterSheet(this.styleSheetURI, this.sss.AGENT_SHEET); + const rv = this.sss.sheetRegistered(this.styleSheetURI, this.sss.AGENT_SHEET); await IOUtils.remove(this.styleSheetPath, { ignoreAbsent: true }); - if ( - !this.sss.sheetRegistered(this.styleSheetURI, this.sss.AGENT_SHEET) && - !(await IOUtils.exists(this.styleSheetPath)) - ) { + if (!rv && !(await IOUtils.exists(this.styleSheetPath))) { console.debug('[ZenThemesImporter]: Sheet successfully unregistered'); } }