ethcc-demo/src/components/ContractEventAlerts.vue
Eric 28bdd3f3e7
bug fixes
- prevent reload of page when clicking alert "view details" button
- when on the request details page, navigating to a different request, eg via an alert button, works without refreshing the page (data is fetched from the store)
- fixed bug with inserting data into the store on StorageRequested event
- fixed blockNumber not being inserted into the store
2024-06-12 17:46:19 +10:00

28 lines
731 B
Vue

<script setup>
import { onMounted } from 'vue'
import { initDismisses } from 'flowbite'
import AlertWithContent from '@/components/alerts/AlertWithContent.vue'
const alerts = defineModel()
onMounted(() => {
initDismisses()
})
</script>
<template>
<div
v-for="{ event, blockNumber, requestId, slotIdx, state, type } in alerts"
:key="event + blockNumber + requestId"
>
<AlertWithContent
:id="event + blockNumber + requestId"
:title="event"
:type="type"
:btn-more-url="`/request/${requestId}`"
><p>request {{ requestId }} at block {{ blockNumber }}</p>
<p v-if="slotIdx">Slot index: {{ slotIdx }}</p>
<p>State: {{ state }}</p></AlertWithContent
>
</div>
</template>