Reset snack message when hiding.

This is so that the same message will cause the snack
to be shown again.
This commit is contained in:
D. Berge
2021-05-16 19:58:36 +02:00
parent a8850e5d0c
commit 8e4f62e5be

View File

@@ -65,6 +65,16 @@ export default {
snackText (newVal) {
this.snack = !!newVal;
},
snack (newVal) {
// When the snack is hidden (one way or another), clear
// the text so that if we receive the same message again
// afterwards it will be shown. This way, if we get spammed
// we're also not triggering the snack too often.
if (!newVal) {
this.$store.commit('setSnackText', "");
}
}
},