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...');
|
||||
enabled = false;
|
||||
|
||||
if (this.#switcherThemeGtk) {
|
||||
this.#switcherThemeGtk.disable();
|
||||
this.#switcherThemeShell.disable();
|
||||
this.#switcherThemeIcon.disable();
|
||||
this.#switcherThemeCursor.disable();
|
||||
this.#switcherCommands.disable();
|
||||
this.#timer.disable();
|
||||
|
||||
this.#timer = null;
|
||||
this.#switcherThemeGtk = null;
|
||||
}
|
||||
if (this.#switcherThemeShell) {
|
||||
this.#switcherThemeShell.disable();
|
||||
this.#switcherThemeShell = null;
|
||||
}
|
||||
if (this.#switcherThemeIcon) {
|
||||
this.#switcherThemeIcon.disable();
|
||||
this.#switcherThemeIcon = null;
|
||||
}
|
||||
if (this.#switcherThemeCursor) {
|
||||
this.#switcherThemeCursor.disable();
|
||||
this.#switcherThemeCursor = null;
|
||||
}
|
||||
if (this.#switcherCommands) {
|
||||
this.#switcherCommands.disable();
|
||||
this.#switcherCommands = null;
|
||||
}
|
||||
if (this.#timer) {
|
||||
this.#timer.disable();
|
||||
this.#timer = null;
|
||||
}
|
||||
|
||||
console.debug('Extension disabled.');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user