Skip to content

Commit dff1df2

Browse files
committed
Fix for unconfigured toolbox
1 parent 59c6a5f commit dff1df2

2 files changed

Lines changed: 10 additions & 13 deletions

File tree

src/components/tools/block.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ export default class BlockTool extends BaseTool<IBlockTool> {
8787
const userToolboxSettings = this.config[UserSettings.Toolbox];
8888

8989
if (_.isEmpty(toolToolboxSettings)) {
90-
return;
90+
return [];
9191
}
9292
if (userToolboxSettings === false) {
93-
return;
93+
return [];
9494
}
9595
/**
9696
* Return tool's toolbox settings if user settings are not defined

src/components/ui/toolbox.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -255,17 +255,14 @@ export default class Toolbox extends EventsDispatcher<ToolboxEvent> {
255255
.from(this.tools.values())
256256
.reduce((result, tool) => {
257257
const toolToolboxSettings = tool.toolbox;
258-
259-
if (toolToolboxSettings) {
260-
const validToolboxSettings = toolToolboxSettings.filter(item => {
261-
return this.areToolboxSettingsValid(item, tool.name);
262-
});
263-
264-
result.push({
265-
...tool,
266-
toolbox: validToolboxSettings,
267-
});
268-
}
258+
const validToolboxSettings = toolToolboxSettings.filter(item => {
259+
return this.areToolboxSettingsValid(item, tool.name);
260+
});
261+
262+
result.push({
263+
...tool,
264+
toolbox: validToolboxSettings,
265+
});
269266

270267
return result;
271268
}, []);

0 commit comments

Comments
 (0)