fix: Make sure to remove the stylesheets before removing the file, b=(no-bug), c=mods

This commit is contained in:
Mr. M
2025-05-13 13:38:47 +02:00
parent 6552ec5f02
commit 66e0dde1ed

View File

@@ -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');
}
}