/ Fixed toast card method

This commit is contained in:
Alexis
2021-03-29 11:11:05 +02:00
parent a9f89fe5d6
commit 2043dfb3c4

View File

@@ -12,8 +12,6 @@
<script> <script>
import { defineComponent } from '@vue/composition-api' import { defineComponent } from '@vue/composition-api'
import store from '@/store'
export default defineComponent({ export default defineComponent({
name: 'ToastCard', name: 'ToastCard',
props: { props: {
@@ -24,7 +22,8 @@ export default defineComponent({
}, },
data () { data () {
return { return {
closing: false closing: false,
tickingRate: 900
} }
}, },
mounted () { mounted () {
@@ -38,17 +37,17 @@ export default defineComponent({
setTimeout(() => { setTimeout(() => {
timeToLive = timeToLive - 1 timeToLive = timeToLive - 1
this.countdown(timeToLive) this.countdown(timeToLive)
}, 900) }, this.tickingRate)
} else { } else {
// When timer ends // When timer ends
this.closing = true this.closing = true
setTimeout(() => { setTimeout(() => {
this.close() this.close()
}, 1200) }, this.tickingRate)
} }
}, },
close () { close () {
store.dispatch('toasts/purgeToast', this.toast.id) this.$store.dispatch('toasts/purgeToast', this.toast.id)
} }
} }
}) })