Extension: Only disable a module if it exists
This commit is contained in:
+19
-7
@@ -69,19 +69,31 @@ class NightThemeSwitcher {
|
|||||||
console.debug('Disabling extension...');
|
console.debug('Disabling extension...');
|
||||||
enabled = false;
|
enabled = false;
|
||||||
|
|
||||||
|
if (this.#switcherThemeGtk) {
|
||||||
this.#switcherThemeGtk.disable();
|
this.#switcherThemeGtk.disable();
|
||||||
this.#switcherThemeShell.disable();
|
|
||||||
this.#switcherThemeIcon.disable();
|
|
||||||
this.#switcherThemeCursor.disable();
|
|
||||||
this.#switcherCommands.disable();
|
|
||||||
this.#timer.disable();
|
|
||||||
|
|
||||||
this.#timer = null;
|
|
||||||
this.#switcherThemeGtk = null;
|
this.#switcherThemeGtk = null;
|
||||||
|
}
|
||||||
|
if (this.#switcherThemeShell) {
|
||||||
|
this.#switcherThemeShell.disable();
|
||||||
this.#switcherThemeShell = null;
|
this.#switcherThemeShell = null;
|
||||||
|
}
|
||||||
|
if (this.#switcherThemeIcon) {
|
||||||
|
this.#switcherThemeIcon.disable();
|
||||||
this.#switcherThemeIcon = null;
|
this.#switcherThemeIcon = null;
|
||||||
|
}
|
||||||
|
if (this.#switcherThemeCursor) {
|
||||||
|
this.#switcherThemeCursor.disable();
|
||||||
this.#switcherThemeCursor = null;
|
this.#switcherThemeCursor = null;
|
||||||
|
}
|
||||||
|
if (this.#switcherCommands) {
|
||||||
|
this.#switcherCommands.disable();
|
||||||
this.#switcherCommands = null;
|
this.#switcherCommands = null;
|
||||||
|
}
|
||||||
|
if (this.#timer) {
|
||||||
|
this.#timer.disable();
|
||||||
|
this.#timer = null;
|
||||||
|
}
|
||||||
|
|
||||||
console.debug('Extension disabled.');
|
console.debug('Extension disabled.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user