Skip to content

Commit

Permalink
fix(editor): Fix bug with node version
Browse files Browse the repository at this point in the history
  • Loading branch information
janober committed May 3, 2022
1 parent d6e5de5 commit ed56481
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/editor-ui/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -850,13 +850,13 @@ export const store = new Vuex.Store({
}, []);
},

nodeType: (state, getters) => (nodeType: string, typeVersion?: number): INodeTypeDescription | null => {
nodeType: (state, getters) => (nodeType: string, version?: number): INodeTypeDescription | null => {
const foundType = state.nodeTypes.find(typeData => {
const typeVersion = Array.isArray(typeData.version)
? typeData.version
: [typeData.version];

return typeData.name === nodeType && typeVersion.some(versions => [typeVersion, typeData.defaultVersion, DEFAULT_NODETYPE_VERSION].includes(versions));
return typeData.name === nodeType && typeVersion.includes(version || typeData.defaultVersion || DEFAULT_NODETYPE_VERSION);
});

if (foundType === undefined) {
Expand Down

0 comments on commit ed56481

Please sign in to comment.