From 5d1b0fba9b7ae0e9b6f3994bd7ddd144513b195f Mon Sep 17 00:00:00 2001
From: liangping <18786721@qq.com>
Date: Mon, 25 Dec 2023 15:02:40 +0800
Subject: [PATCH] add type check
---
src/modules/[chain]/staking/[validator].vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/modules/[chain]/staking/[validator].vue b/src/modules/[chain]/staking/[validator].vue
index f33652f3..5a99895e 100644
--- a/src/modules/[chain]/staking/[validator].vue
+++ b/src/modules/[chain]/staking/[validator].vue
@@ -224,7 +224,7 @@ function pagePowerEvents(page: number) {
function mapEvents(events: {type: string, attributes: {key: string, value: string}[]}[]) {
const attributes = events.filter(x => x.type=== selectedEventType.value).filter(x => x.attributes.findIndex(attr => attr.value === toBase64(stringToUint8Array(validator))) > -1).map(x => {
// check if attributes need to decode
- if(x.attributes.findIndex(a => a.value === `amount` || a.value === 'delegator_address') > -1) return x.attributes
+ if(x.attributes.findIndex(a => a.value === `amount`) > -1) return x.attributes
const output = {} as {[key: string]: string }
x.attributes.forEach(attr => {
output[uint8ArrayToString(fromBase64(attr.key))] = uint8ArrayToString(fromBase64(attr.value))
@@ -672,7 +672,7 @@ function mapDelegators(messages: any[]) {
{{ (selectedEventType === EventType.Delegate ? '+' : '-')}} {{
- mapEvents(item.events).map(x => x.amount).join(", ")
+ mapEvents(item.events).map((x: any) => x.amount).join(", ")
}}