✏️ 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,
|
||||||
@ -73,6 +78,7 @@ if (eventQueuStore.size != 0) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getIcon(type: string) {
|
function getIcon(type: string) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user