Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: do not add "none" tool in Configure Toolbar dialog (#2193)

Muhammad Ali2fb2c4247aa4
diff --git a/apps/web/src/components/dialogs/toolbar-config-dialog.tsx b/apps/web/src/components/dialogs/toolbar-config-dialog.tsx
index cd65cd205..f94194519 100644
--- a/apps/web/src/components/dialogs/toolbar-config-dialog.tsx
+++ b/apps/web/src/components/dialogs/toolbar-config-dialog.tsx
@@ -714,8 +714,9 @@ export function getDisabledTools(tools: TreeNode[]) {
for (const key in allTools) {
const tool = allTools[key as ToolId];
if (tool.conditional) continue;
- if (items.findIndex((t) => t.toolId === key) <= -1)
- disabled.push(key as ToolId);
+
+ const isDisabled = items.findIndex((t) => t.toolId === key);
+ if (isDisabled === -1 && key !== "none") disabled.push(key as ToolId);
}
return disabled;
}