Skip to content

Commit

Permalink
Error when mounting duplicate plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
owen-m1 committed Dec 29, 2020
1 parent 88838bf commit 8b1d76d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/PluginManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ export default {
plugin[option] = defaults[option];
}
}

plugins.forEach(p => {
if (p.pluginName === plugin.pluginName) {
throw (`Sortable: Cannot mount plugin ${ plugin.pluginName } more than once`);
}
});

plugins.push(plugin);
},
pluginEvent(eventName, sortable, evt) {
Expand Down

0 comments on commit 8b1d76d

Please sign in to comment.