From 412148ee51b2e6a224fc2f9a1c2dc80569da130d Mon Sep 17 00:00:00 2001 From: ZanzyTHEbar Date: Tue, 18 Feb 2025 21:09:22 +0000 Subject: [PATCH] fix: reorganize cleanup logic in extension.ts to fix bug with indicator being destroyed prematurely - my dumb ass was destroying the indicator during the initialization sequence. --- gnome-extension/src/extension.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/gnome-extension/src/extension.ts b/gnome-extension/src/extension.ts index 3a6096f..3f92cb7 100644 --- a/gnome-extension/src/extension.ts +++ b/gnome-extension/src/extension.ts @@ -111,22 +111,22 @@ export default class VSCodeWorkspacesExtension extends Extension { } disable() { - this._cleanup() - this._log(`VSCode Workspaces Extension disabled`); - } - - - private _cleanup() { + this._cleanup(); if (this._refreshTimeout) { GLib.source_remove(this._refreshTimeout); this._refreshTimeout = null; } + if (this._indicator) { this._indicator.destroy(); this._indicator = undefined; } this.gsettings = undefined; + this._log(`VSCode Workspaces Extension disabled`); + } + + private _cleanup() { // clean up the cache this._workspaces.clear(); this._recentWorkspaces.clear(); @@ -203,7 +203,6 @@ export default class VSCodeWorkspacesExtension extends Extension { this._nofailList = this.gsettings.get_value('nofail-workspaces').deepUnpack() ?? []; this._customCmdArgs = this.gsettings.get_value('custom-cmd-args').deepUnpack() ?? ''; - this._log(`Workspaces Extension enabled`); this._log(`New Window: ${this._newWindow}`); this._log(`Workspaces Storage Location: ${this._editorLocation}`); this._log(`Refresh Interval: ${this._refreshInterval}`);