mirror of
https://github.com/codex-team/editor.js
synced 2026-03-14 22:55:47 +01:00
Fix for unconfigured toolbox
This commit is contained in:
parent
59c6a5f471
commit
dff1df2304
2 changed files with 10 additions and 13 deletions
|
|
@ -87,10 +87,10 @@ export default class BlockTool extends BaseTool<IBlockTool> {
|
|||
const userToolboxSettings = this.config[UserSettings.Toolbox];
|
||||
|
||||
if (_.isEmpty(toolToolboxSettings)) {
|
||||
return;
|
||||
return [];
|
||||
}
|
||||
if (userToolboxSettings === false) {
|
||||
return;
|
||||
return [];
|
||||
}
|
||||
/**
|
||||
* Return tool's toolbox settings if user settings are not defined
|
||||
|
|
|
|||
|
|
@ -255,17 +255,14 @@ export default class Toolbox extends EventsDispatcher<ToolboxEvent> {
|
|||
.from(this.tools.values())
|
||||
.reduce((result, tool) => {
|
||||
const toolToolboxSettings = tool.toolbox;
|
||||
const validToolboxSettings = toolToolboxSettings.filter(item => {
|
||||
return this.areToolboxSettingsValid(item, tool.name);
|
||||
});
|
||||
|
||||
if (toolToolboxSettings) {
|
||||
const validToolboxSettings = toolToolboxSettings.filter(item => {
|
||||
return this.areToolboxSettingsValid(item, tool.name);
|
||||
});
|
||||
|
||||
result.push({
|
||||
...tool,
|
||||
toolbox: validToolboxSettings,
|
||||
});
|
||||
}
|
||||
result.push({
|
||||
...tool,
|
||||
toolbox: validToolboxSettings,
|
||||
});
|
||||
|
||||
return result;
|
||||
}, []);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue