Skip to content

Commit

Permalink
Fix resurrect alert bug (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
Duddino authored Jan 7, 2025
1 parent f25c800 commit 94a6518
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions scripts/alerts/Alerts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ watch(alerts, () => {
actionFunc: previousAlert.actionFunc,
// Store original message so we can use it as key.
// This skips the animation in case of multiple errors
original: previousAlert.message,
original: previousAlert,
});
res.push(alert);
if (timeout > 0) {
setTimeout(() => {
alert.value.show = false;
alert.value.original.show = false;
}, timeout);
}
}
Expand All @@ -54,23 +54,25 @@ watch(alerts, () => {
*/
function runAction(cAlert) {
cAlert.actionFunc();
cAlert.show = false;
cAlert.original.show = false;
}
</script>
<template>
<transition-group name="alert">
<div
v-for="alert of foldedAlerts.filter((a) => a.value.show)"
:key="alert.value.original"
v-for="alert of foldedAlerts.filter(
(a) => a.value.original.show !== false
)"
:key="alert.value.original.message"
data-testid="alerts"
>
<Alert
:message="alert.value.message"
:level="alert.value.level"
:notificationCount="alert.value.count"
:actionName="alert.value.actionName"
@hideAlert="alert.value.show = false"
@hideAlert="alert.value.original.show = false"
@runAction="runAction(alert.value)"
/>
</div>
Expand Down

0 comments on commit 94a6518

Please sign in to comment.