mirror of
https://github.com/codex-team/editor.js
synced 2024-05-10 10:26:46 +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];
|
||||
|
||||
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…
Reference in a new issue