|
|
|
@ -105,7 +105,7 @@ module.exports = class Filepanel extends ViewPlugin { |
|
|
|
|
if (!item.name || !item.id) throw new Error('Item name and id is mandatory') |
|
|
|
|
if (!item.type && !item.path && !item.extension && !item.pattern) throw new Error('Invalid file matching criteria provided') |
|
|
|
|
if (this.registeredMenuItems.filter((o) => { |
|
|
|
|
return o.id === item.id & o.name === item.name |
|
|
|
|
return o.id === item.id && o.name === item.name |
|
|
|
|
}).length) throw new Error(`Action ${item.name} already exists on ${item.id}`) |
|
|
|
|
this.registeredMenuItems = [...this.registeredMenuItems, item] |
|
|
|
|
this.removedMenuItems = this.removedMenuItems.filter(menuItem => item.id !== menuItem.id) |
|
|
|
|