Skip to content

Commit

Permalink
Check if the dispose has already been done and does nothing | Fixes #582
Browse files Browse the repository at this point in the history
  • Loading branch information
matuzalemsteles committed Feb 22, 2018
1 parent a20fe88 commit a4eb0be
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/clay-alert/src/ClayAlertBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,17 @@ class ClayAlertBase extends Component {
* @private
*/
_defaultHideAlert() {
this._delayTime = 0;
this._visible = false;
if (!this.isDisposed()) {
this._delayTime = 0;
this._visible = false;

if (this._timer) {
clearTimeout(this._timer);
}
if (this._timer) {
clearTimeout(this._timer);
}

if (this.destroyOnHide) {
this.dispose();
if (this.destroyOnHide) {
this.dispose();
}
}
}

Expand Down

0 comments on commit a4eb0be

Please sign in to comment.