Skip to content

Commit

Permalink
Merge pull request #625 from matuzalemsteles/issue-582
Browse files Browse the repository at this point in the history
Check if the dispose has already been done and does nothing | Fixes #582
  • Loading branch information
carloslancha authored Feb 22, 2018
2 parents 5fb382f + a4eb0be commit 0d7333e
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 0d7333e

Please sign in to comment.