Fixed bug where status bar commands would be deleted from the list when the command stopped being available.

This commit is contained in:
David V. Kimball 2025-11-25 23:24:17 -08:00
parent 27d0e167ce
commit 7e38ed7169
4 changed files with 75 additions and 212 deletions

View file

@ -1,7 +1,7 @@
{
"id": "cmdr",
"name": "Commander",
"version": "0.5.4",
"version": "0.5.5",
"minAppVersion": "1.4.0",
"description": "Customize your workspace by adding commands everywhere, create Macros and supercharge your mobile toolbar.",
"author": "jsmorabito & phibr0",

272
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "cmdr",
"version": "0.5.4",
"version": "0.5.5",
"description": "Customize your workspace by adding commands /everywhere/.",
"main": "main.js",
"scripts": {

View file

@ -28,16 +28,13 @@ export default class StatusBarManager extends CommandManagerBase {
this.plugin.app.workspace.onLayoutReady(() => {
this.container = this.plugin.app.statusBar.containerEl;
for (const cmd of this.pairs) {
//Command has been removed
if (!getCommandFromId(cmd.id, this.plugin)) {
this.pairs.remove(cmd);
}
if (isModeActive(cmd.mode, this.plugin)) {
// Only add action if command exists and mode is active
// Don't remove commands from settings if they're temporarily unavailable
// (e.g., from other plugins that haven't loaded yet)
if (getCommandFromId(cmd.id, this.plugin) && isModeActive(cmd.mode, this.plugin)) {
this.addAction(cmd);
}
}
this.plugin.saveSettings();
this.plugin.registerDomEvent(
this.container,