Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
0.8.2 - Fix error on missing child in menuStructure
Browse files Browse the repository at this point in the history
  • Loading branch information
jducro committed Jan 8, 2019
1 parent 4ba54cd commit c4dd722
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.8.2 - 2019-01-08

* Fix error on missing child in menuStructure

## 0.8.1 - 2019-01-07

* Fix scope
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deskpro/token-field",
"version": "0.8.1",
"version": "0.8.2",
"description": "",
"main": "dist/index.js",
"private": false,
Expand Down
10 changes: 7 additions & 3 deletions src/Components/TokenFieldInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,14 @@ export default class TokenFieldInput extends React.Component {
}
return true;
})
.map((child) => {
.reduce((childResult, child) => {
const token = this.props.tokenTypes.find(t => t.id === child.token);
if (!token) {
return childResult;
}
const childLabel = token.label ? token.label : token.id;
const childSelect = (selectLevel === 1 && subSelected === child) ? styles.selected : '';
return (
childResult.push(
<ListElement
key={token.id}
onClick={() => this.selectToken(token)}
Expand All @@ -553,7 +556,8 @@ export default class TokenFieldInput extends React.Component {
{childLabel}
</ListElement>
);
})
return childResult;
}, [])
}
</List>
</ListElement>
Expand Down

0 comments on commit c4dd722

Please sign in to comment.