Skip to content

Commit

Permalink
fix(tool-naming): Pass configuration.name into tool constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
evren217 committed Oct 26, 2018
1 parent 2203303 commit 45b8fc9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/store/addTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const addToolForElement = function (element, apiTool, configuration) {
// Instantiating the tool here makes it harder to accidentally add
// The same tool (by reference) for multiple elements (which would reassign the tool
// To a new element).
const tool = new apiTool(configuration);
const tool = new apiTool(configuration.name);

const toolAlreadyAddedToElement = getToolForElement(element, tool.name);

Expand All @@ -39,7 +39,7 @@ const addToolForElement = function (element, apiTool, configuration) {
const addTool = function (apiTool, configuration) {
_addToolGlobally(apiTool, configuration);
store.state.enabledElements.forEach((element) => {
addToolForElement(element, apiTool);
addToolForElement(element, apiTool, configuration);
});
};

Expand All @@ -57,7 +57,7 @@ const _addToolGlobally = function (apiTool, configuration) {
return;
}

const tool = new apiTool(configuration);
const tool = new apiTool(configuration.name);
const toolAlreadyAddedGlobally =
store.state.globalTools[tool.name] !== undefined;

Expand Down

0 comments on commit 45b8fc9

Please sign in to comment.