mirror of
https://github.com/codex-team/editor.js
synced 2024-06-14 03:35:44 +02:00
Fix for unconfigured toolbox
This commit is contained in:
parent
59c6a5f471
commit
dff1df2304
|
@ -87,10 +87,10 @@ export default class BlockTool extends BaseTool<IBlockTool> {
|
||||||
const userToolboxSettings = this.config[UserSettings.Toolbox];
|
const userToolboxSettings = this.config[UserSettings.Toolbox];
|
||||||
|
|
||||||
if (_.isEmpty(toolToolboxSettings)) {
|
if (_.isEmpty(toolToolboxSettings)) {
|
||||||
return;
|
return [];
|
||||||
}
|
}
|
||||||
if (userToolboxSettings === false) {
|
if (userToolboxSettings === false) {
|
||||||
return;
|
return [];
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Return tool's toolbox settings if user settings are not defined
|
* Return tool's toolbox settings if user settings are not defined
|
||||||
|
|
|
@ -255,8 +255,6 @@ export default class Toolbox extends EventsDispatcher<ToolboxEvent> {
|
||||||
.from(this.tools.values())
|
.from(this.tools.values())
|
||||||
.reduce((result, tool) => {
|
.reduce((result, tool) => {
|
||||||
const toolToolboxSettings = tool.toolbox;
|
const toolToolboxSettings = tool.toolbox;
|
||||||
|
|
||||||
if (toolToolboxSettings) {
|
|
||||||
const validToolboxSettings = toolToolboxSettings.filter(item => {
|
const validToolboxSettings = toolToolboxSettings.filter(item => {
|
||||||
return this.areToolboxSettingsValid(item, tool.name);
|
return this.areToolboxSettingsValid(item, tool.name);
|
||||||
});
|
});
|
||||||
|
@ -265,7 +263,6 @@ export default class Toolbox extends EventsDispatcher<ToolboxEvent> {
|
||||||
...tool,
|
...tool,
|
||||||
toolbox: validToolboxSettings,
|
toolbox: validToolboxSettings,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
Loading…
Reference in a new issue