forked from cerc-io/cosmos-explorer
improve incompatible events display
This commit is contained in:
parent
6a4d1952ed
commit
84e26e26ad
@ -122,6 +122,13 @@ function loadAccount(address: string) {
|
|||||||
function updateEvent() {
|
function updateEvent() {
|
||||||
loadAccount(props.address);
|
loadAccount(props.address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function mapAmount(events:{type: string, attributes: {key: string, value: string}[]}[]) {
|
||||||
|
if(!events) return []
|
||||||
|
return events.find(x => x.type==='coin_received')?.attributes
|
||||||
|
.filter(x => x.key === 'YW1vdW50'|| x.key === `amount`)
|
||||||
|
.map(x => x.key==='amount'? x.value : String.fromCharCode(...fromBase64(x.value)))
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div v-if="account">
|
<div v-if="account">
|
||||||
@ -571,7 +578,7 @@ function updateEvent() {
|
|||||||
</td>
|
</td>
|
||||||
<td class="flex items-center py-3">
|
<td class="flex items-center py-3">
|
||||||
<div class="mr-2">
|
<div class="mr-2">
|
||||||
{{ v.events.find(x => x.type==='coin_received')?.attributes.filter(x => x.key === 'YW1vdW50').map(x => String.fromCharCode(...fromBase64(x.value))).join(", ")}}
|
{{ mapAmount(v.events)?.join(", ")}}
|
||||||
</div>
|
</div>
|
||||||
<Icon
|
<Icon
|
||||||
v-if="v.code === 0"
|
v-if="v.code === 0"
|
||||||
|
Loading…
Reference in New Issue
Block a user