mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-07-12 05:24:45 +02:00
editor: make editor tools object a function
Required for string localization to work properly
This commit is contained in:
@@ -21,7 +21,7 @@ import { ToolbarDefinition, ToolDefinition } from "./types.js";
|
||||
import { ToolId } from "./tools/index.js";
|
||||
import { strings } from "@notesnook/intl";
|
||||
|
||||
const tools: Record<ToolId, ToolDefinition> = {
|
||||
const tools = (): Record<ToolId, ToolDefinition> => ({
|
||||
none: {
|
||||
icon: "none",
|
||||
title: ""
|
||||
@@ -356,14 +356,14 @@ const tools: Record<ToolId, ToolDefinition> = {
|
||||
title: strings.exportCsv(),
|
||||
conditional: true
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
export function getToolDefinition(id: ToolId) {
|
||||
return tools[id];
|
||||
return tools()[id];
|
||||
}
|
||||
|
||||
export function getAllTools() {
|
||||
return tools;
|
||||
return tools();
|
||||
}
|
||||
|
||||
export function getDefaultPresets() {
|
||||
|
||||
Reference in New Issue
Block a user