Unverified Commit 8a250941 authored by David Disu's avatar David Disu Committed by GitHub

Merge pull request #1347 from ethereum/patchfilepanel

bugfix for context menu
parents f9972626 0d4d374c
...@@ -105,7 +105,7 @@ module.exports = class Filepanel extends ViewPlugin { ...@@ -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.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 (!item.type && !item.path && !item.extension && !item.pattern) throw new Error('Invalid file matching criteria provided')
if (this.registeredMenuItems.filter((o) => { 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}`) }).length) throw new Error(`Action ${item.name} already exists on ${item.id}`)
this.registeredMenuItems = [...this.registeredMenuItems, item] this.registeredMenuItems = [...this.registeredMenuItems, item]
this.removedMenuItems = this.removedMenuItems.filter(menuItem => item.id !== menuItem.id) this.removedMenuItems = this.removedMenuItems.filter(menuItem => item.id !== menuItem.id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment