mirror of
https://github.com/devonthesofa/obsidian-note-status.git
synced 2026-07-22 12:30:24 +00:00
fix: remove editor toolbar buttons when the toggle is off
This commit is contained in:
parent
658de2cebc
commit
63a6097a4a
1 changed files with 5 additions and 1 deletions
|
|
@ -130,7 +130,7 @@ export class EditorToolbarIntegration {
|
|||
const targetLeaves = new Set(this.getTargetLeaves());
|
||||
|
||||
// Remove buttons that shouldn't exist
|
||||
for (const leaf of this.leafButtons.keys()) {
|
||||
for (const leaf of Array.from(this.leafButtons.keys())) {
|
||||
if (!targetLeaves.has(leaf)) {
|
||||
this.removeButtonForLeaf(leaf);
|
||||
}
|
||||
|
|
@ -214,6 +214,10 @@ export class EditorToolbarIntegration {
|
|||
}
|
||||
|
||||
private getTargetLeaves(): WorkspaceLeaf[] {
|
||||
if (!settingsService.settings.showEditorToolbarButton) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const leaves: WorkspaceLeaf[] = [];
|
||||
|
||||
if (
|
||||
|
|
|
|||
Loading…
Reference in a new issue