From 8723c8499b6a312a90fd019d256e2d2085ea0170 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sat, 22 Mar 2025 14:05:54 +0000 Subject: [PATCH] Fix status bar disabled state --- .../obsidian-plugin/src/views/status-bar.ts | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/frontend/obsidian-plugin/src/views/status-bar.ts b/frontend/obsidian-plugin/src/views/status-bar.ts index 84e7586c..3e35d93a 100644 --- a/frontend/obsidian-plugin/src/views/status-bar.ts +++ b/frontend/obsidian-plugin/src/views/status-bar.ts @@ -35,6 +35,18 @@ export class StatusBar { cls: ["sync-status"] }); + if (!this.syncClient.getSettings().isSyncEnabled) { + const button = container.createEl("button", { + text: "VaultLink is disabled, click to configure", + cls: "initialize-button" + }); + button.onclick = (): void => { + this.plugin.openSettings(); + }; + + return; + } + let hasShownMessage = false; if ((this.lastRemaining ?? 0) > 0) { @@ -57,17 +69,7 @@ export class StatusBar { } if (!hasShownMessage) { - if (this.syncClient.getSettings().isSyncEnabled) { - container.createSpan({ text: "VaultLink is idle" }); - } else { - const button = container.createEl("button", { - text: "VaultLink is disabled, click to configure", - cls: "initialize-button" - }); - button.onclick = (): void => { - this.plugin.openSettings(); - }; - } + container.createSpan({ text: "VaultLink is idle" }); } } }