fix: remove editor toolbar buttons when the toggle is off

This commit is contained in:
Aleix Soler 2025-11-17 18:24:31 +01:00
parent 658de2cebc
commit 63a6097a4a

View file

@ -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 (