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;
|
const { Timer } = Me.imports.modules.Timer;
|
||||||
|
|
||||||
|
|
||||||
var enabled = false;
|
|
||||||
|
|
||||||
|
|
||||||
class NightThemeSwitcher {
|
class NightThemeSwitcher {
|
||||||
#timer = null;
|
#timer = null;
|
||||||
#switcherThemeGtk = null;
|
#switcherThemeGtk = null;
|
||||||
@@ -58,7 +55,6 @@ class NightThemeSwitcher {
|
|||||||
this.#switcherThemeCursor.enable();
|
this.#switcherThemeCursor.enable();
|
||||||
this.#switcherCommands.enable();
|
this.#switcherCommands.enable();
|
||||||
|
|
||||||
enabled = true;
|
|
||||||
console.debug('Extension started.');
|
console.debug('Extension started.');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +63,6 @@ class NightThemeSwitcher {
|
|||||||
// to enable the color scheme switch while the lock screen is displayed,
|
// 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.
|
// as the background image and the shell theme are visible in this mode.
|
||||||
console.debug('Disabling extension...');
|
console.debug('Disabling extension...');
|
||||||
enabled = false;
|
|
||||||
|
|
||||||
if (this.#switcherThemeGtk) {
|
if (this.#switcherThemeGtk) {
|
||||||
this.#switcherThemeGtk.disable();
|
this.#switcherThemeGtk.disable();
|
||||||
|
|||||||
@@ -184,10 +184,6 @@ var TimerLocation = class {
|
|||||||
#watchForTimeChange() {
|
#watchForTimeChange() {
|
||||||
console.debug('Watching for time change...');
|
console.debug('Watching for time change...');
|
||||||
this.#timeChangeTimer = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 1, () => {
|
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()) {
|
if (this.#previouslyDaytime !== this.#isDaytime()) {
|
||||||
this.#previouslyDaytime = this.#isDaytime();
|
this.#previouslyDaytime = this.#isDaytime();
|
||||||
this.emit('time-changed', this.time);
|
this.emit('time-changed', this.time);
|
||||||
|
|||||||
@@ -58,10 +58,6 @@ var TimerSchedule = class {
|
|||||||
#watchForTimeChange() {
|
#watchForTimeChange() {
|
||||||
console.debug('Watching for time change...');
|
console.debug('Watching for time change...');
|
||||||
this.#timeChangeTimer = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 1, () => {
|
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()) {
|
if (this.#previouslyDaytime !== this.#isDaytime()) {
|
||||||
this.#previouslyDaytime = this.#isDaytime();
|
this.#previouslyDaytime = this.#isDaytime();
|
||||||
this.emit('time-changed', this.time);
|
this.emit('time-changed', this.time);
|
||||||
|
|||||||
Reference in New Issue
Block a user