fix(front/FlashMessages): only display relevant flash bags

This commit is contained in:
Alice Gaudon 2022-03-06 13:20:20 +01:00
parent 2c3286d313
commit ee56113808

View File

@ -3,6 +3,13 @@
import Message from "./Message.svelte";
export let flashed = $locals.flash;
const displayedCategories = [
'success',
'info',
'warning',
'error',
'error-alert',
];
</script>
<style lang="scss">
@ -13,7 +20,7 @@
<div class="messages">
{#if flashed}
{#each Object.entries(flashed) as [key, bag], i}
{#each Object.entries(flashed).filter(entry => displayedCategories.indexOf(entry[0]) >= 0) as [key, bag], i}
{#each bag as content}
<Message type={key} content={content}/>
{/each}