Skip to content

Commit

Permalink
Merge pull request #2335 from MyCryptoHQ/hotfix/unit-dropdown-not-res…
Browse files Browse the repository at this point in the history
…etting

Hotfix 1.5.3 - Unit dropdown not resetting.
  • Loading branch information
ConnorBryan authored Dec 21, 2018
2 parents 283a460 + 6b97dcf commit 9f46157
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion common/components/ui/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,26 @@ interface Props extends ReactSelectProps {
onChange: any;
}

interface State {
selectedOption: any;
hasBlurred: boolean;
}

export default class Dropdown extends React.Component<Props> {
public state = {
public state: State = {
selectedOption: this.props.value || '',
hasBlurred: false
};

public componentDidUpdate(_: Props, prevState: State) {
const { value } = this.props;
const { selectedOption } = prevState;

if (selectedOption !== value) {
this.setState({ selectedOption: value });
}
}

public handleChange = (selectedOption: Option) => {
this.setState({ selectedOption });
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "MyCrypto",
"author": "MyCryptoHQ",
"version": "1.5.2",
"version": "1.5.3",
"main": "main.js",
"description": "MyCrypto web and electron app",
"repository": "https://github.com/MyCryptoHQ/MyCrypto",
Expand Down

0 comments on commit 9f46157

Please sign in to comment.