Skip to content

Commit

Permalink
Fixed #1415 - Toast does not clear hide timeout on unmount
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Aug 6, 2021
1 parent 81f2a65 commit 0333cf1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/toast/ToastMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,22 @@ export default {
}, this.message.life)
}
},
beforeUnmount() {
this.clearCloseTimeout();
},
methods: {
close() {
this.$emit('close', this.message);
},
onCloseClick() {
this.clearCloseTimeout();
this.close();
},
clearCloseTimeout() {
if (this.closeTimeout) {
clearTimeout(this.closeTimeout);
this.closeTimeout = null;
}
this.close();
}
},
computed: {
Expand Down

0 comments on commit 0333cf1

Please sign in to comment.