Extension: Remove unused enabled global variable
This commit is contained in:
@@ -16,9 +16,6 @@ const { SwitcherThemeCursor, SwitcherThemeGtk, SwitcherThemeIcon, SwitcherThemeS
|
||||
const { Timer } = Me.imports.modules.Timer;
|
||||
|
||||
|
||||
var enabled = false;
|
||||
|
||||
|
||||
class NightThemeSwitcher {
|
||||
#timer = null;
|
||||
#switcherThemeGtk = null;
|
||||
@@ -58,7 +55,6 @@ class NightThemeSwitcher {
|
||||
this.#switcherThemeCursor.enable();
|
||||
this.#switcherCommands.enable();
|
||||
|
||||
enabled = true;
|
||||
console.debug('Extension started.');
|
||||
}
|
||||
|
||||
@@ -67,7 +63,6 @@ class NightThemeSwitcher {
|
||||
// to enable the color scheme switch while the lock screen is displayed,
|
||||
// as the background image and the shell theme are visible in this mode.
|
||||
console.debug('Disabling extension...');
|
||||
enabled = false;
|
||||
|
||||
if (this.#switcherThemeGtk) {
|
||||
this.#switcherThemeGtk.disable();
|
||||
|
||||
@@ -184,10 +184,6 @@ var TimerLocation = class {
|
||||
#watchForTimeChange() {
|
||||
console.debug('Watching for time change...');
|
||||
this.#timeChangeTimer = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 1, () => {
|
||||
if (!Me.imports.extension.enabled) {
|
||||
// The extension doesn't exist anymore, quit the loop
|
||||
return GLib.SOURCE_REMOVE;
|
||||
}
|
||||
if (this.#previouslyDaytime !== this.#isDaytime()) {
|
||||
this.#previouslyDaytime = this.#isDaytime();
|
||||
this.emit('time-changed', this.time);
|
||||
|
||||
@@ -58,10 +58,6 @@ var TimerSchedule = class {
|
||||
#watchForTimeChange() {
|
||||
console.debug('Watching for time change...');
|
||||
this.#timeChangeTimer = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 1, () => {
|
||||
if (!Me.imports.extension.enabled) {
|
||||
// The extension doesn't exist anymore, quit the loop
|
||||
return GLib.SOURCE_REMOVE;
|
||||
}
|
||||
if (this.#previouslyDaytime !== this.#isDaytime()) {
|
||||
this.#previouslyDaytime = this.#isDaytime();
|
||||
this.emit('time-changed', this.time);
|
||||
|
||||
Reference in New Issue
Block a user