Fixed #1415 - Toast does not clear hide timeout on unmount

pull/1440/head
Cagatay Civici 2021-08-06 10:29:07 +03:00
parent 81f2a65638
commit 0333cf1fce
1 changed files with 8 additions and 2 deletions

View File

@ -34,16 +34,22 @@ export default {
}, this.message.life) }, this.message.life)
} }
}, },
beforeUnmount() {
this.clearCloseTimeout();
},
methods: { methods: {
close() { close() {
this.$emit('close', this.message); this.$emit('close', this.message);
}, },
onCloseClick() { onCloseClick() {
this.clearCloseTimeout();
this.close();
},
clearCloseTimeout() {
if (this.closeTimeout) { if (this.closeTimeout) {
clearTimeout(this.closeTimeout); clearTimeout(this.closeTimeout);
this.closeTimeout = null;
} }
this.close();
} }
}, },
computed: { computed: {