fix(front/FlashMessages): only display relevant flash bags
This commit is contained in:
parent
2c3286d313
commit
ee56113808
@ -3,6 +3,13 @@
|
|||||||
import Message from "./Message.svelte";
|
import Message from "./Message.svelte";
|
||||||
|
|
||||||
export let flashed = $locals.flash;
|
export let flashed = $locals.flash;
|
||||||
|
const displayedCategories = [
|
||||||
|
'success',
|
||||||
|
'info',
|
||||||
|
'warning',
|
||||||
|
'error',
|
||||||
|
'error-alert',
|
||||||
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@ -13,7 +20,7 @@
|
|||||||
|
|
||||||
<div class="messages">
|
<div class="messages">
|
||||||
{#if flashed}
|
{#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}
|
{#each bag as content}
|
||||||
<Message type={key} content={content}/>
|
<Message type={key} content={content}/>
|
||||||
{/each}
|
{/each}
|
||||||
|
Loading…
Reference in New Issue
Block a user