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";
|
||||
|
||||
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}
|
||||
|
Loading…
Reference in New Issue
Block a user