Skip to content

Commit

Permalink
Show the banner if there's a new message (even if the message content…
Browse files Browse the repository at this point in the history
…s did not change) (#1352)
  • Loading branch information
tomsb committed Aug 14, 2023
1 parent 4b4ca45 commit 83738ba
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions stubs/inertia/resources/js/Components/Banner.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<script setup>
import { computed, ref, watch } from 'vue';
import {ref, watchEffect} from 'vue';
import { usePage } from '@inertiajs/vue3';
const show = ref(true);
const style = computed(() => usePage().props.jetstream.flash?.bannerStyle || 'success');
const message = computed(() => usePage().props.jetstream.flash?.banner || '');
const style = ref('success');
const message = ref('');
watch(message, async () => {
show.value = true;
watchEffect(async () => {
style.value = usePage().props.jetstream.flash?.bannerStyle || 'success';
message.value = usePage().props.jetstream.flash?.banner || '';
show.value = true;
});
</script>
Expand Down

0 comments on commit 83738ba

Please sign in to comment.