Splice fix

This commit is contained in:
kylejwatson 2020-08-02 15:52:48 +01:00
parent bfadb57694
commit 56e13c79ca
1 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ export default Vue.extend({
}, },
close: function (toast) { close: function (toast) {
// Wait for fade-out to finish // Wait for fade-out to finish
setTimeout(this.remove, 300, this.toasts.length) setTimeout(this.remove, 300, 0)
toast.isOpen = false toast.isOpen = false
}, },
@ -36,7 +36,7 @@ export default Vue.extend({
}, },
remove: function(index) { remove: function(index) {
const removed = this.toasts.splice(index, 1) const removed = this.toasts.splice(index, 1)
clearTimeout(removed.timeout) clearTimeout(removed[0].timeout)
} }
}, },
}) })