Fix status bar disabled state
This commit is contained in:
parent
2722f7c7fc
commit
8723c8499b
1 changed files with 13 additions and 11 deletions
|
|
@ -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" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue