✏️ Prevent mutiple messages
This commit is contained in:
parent
9a8f1b112a
commit
be82cc4aa1
@ -39,6 +39,9 @@ eventQueuStore.$subscribe((mutation, state) => {
|
|||||||
if (state.events.length != 0) {
|
if (state.events.length != 0) {
|
||||||
let event = eventQueuStore.shift();
|
let event = eventQueuStore.shift();
|
||||||
if (event?.uuid) {
|
if (event?.uuid) {
|
||||||
|
if (
|
||||||
|
snacks.value.filter((value) => value.text == event?.text).length == 0
|
||||||
|
) {
|
||||||
snacks.value.push({
|
snacks.value.push({
|
||||||
snack: true,
|
snack: true,
|
||||||
text: event.text,
|
text: event.text,
|
||||||
@ -48,6 +51,7 @@ eventQueuStore.$subscribe((mutation, state) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
@ -64,6 +68,7 @@ watch(
|
|||||||
if (eventQueuStore.size != 0) {
|
if (eventQueuStore.size != 0) {
|
||||||
let event = eventQueuStore.shift();
|
let event = eventQueuStore.shift();
|
||||||
if (event?.uuid) {
|
if (event?.uuid) {
|
||||||
|
if (snacks.value.filter((value) => value.text == event?.text).length == 0) {
|
||||||
snacks.value.push({
|
snacks.value.push({
|
||||||
snack: true,
|
snack: true,
|
||||||
text: event.text,
|
text: event.text,
|
||||||
@ -72,6 +77,7 @@ if (eventQueuStore.size != 0) {
|
|||||||
icon: getIcon(event.type),
|
icon: getIcon(event.type),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getIcon(type: string) {
|
function getIcon(type: string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user