Skip to content

Commit

Permalink
Merge pull request #25 from PocketDerm/fix-alert
Browse files Browse the repository at this point in the history
[Alerts] Prevent calling exit multiple times
  • Loading branch information
snags88 authored Nov 28, 2018
2 parents adbec22 + 9ec5ed4 commit 8fbfb97
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/shared-components/alert/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ class Alert extends React.Component {
const { onExit, ...rest} = this.props;
this.setState({ exiting: true });

// eslint-disable-next-line no-undef
window.clearTimeout(this.timer);

// eslint-disable-next-line no-undef
window.setTimeout(() => {
onExit({...rest});
Expand Down

0 comments on commit 8fbfb97

Please sign in to comment.