Fix status bar disabled state

This commit is contained in:
Andras Schmelczer 2025-03-22 14:05:54 +00:00
parent 2722f7c7fc
commit 8723c8499b
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C

View file

@ -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" });
}
}
}