From 2d238018e1e69d7f52120bdd6a2df23600c8a9cd Mon Sep 17 00:00:00 2001 From: Pham Tu Date: Fri, 26 Jan 2024 11:03:01 +0700 Subject: [PATCH] check total --- src/modules/[chain]/ibc/connection/[connection_id].vue | 8 +++++--- src/stores/useFormatter.ts | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/modules/[chain]/ibc/connection/[connection_id].vue b/src/modules/[chain]/ibc/connection/[connection_id].vue index c5814ddb..acc8ba71 100644 --- a/src/modules/[chain]/ibc/connection/[connection_id].vue +++ b/src/modules/[chain]/ibc/connection/[connection_id].vue @@ -53,6 +53,7 @@ onMounted(() => { if (connId.value) { chainStore.rpc.getIBCConnectionsById(connId.value).then((x) => { conn.value = x.connection; + console.log('getIBCConnectionsClientState', conn.value); }); chainStore.rpc.getIBCConnectionsClientState(connId.value).then((x) => { // @ts-ignore @@ -65,7 +66,6 @@ onMounted(() => { ) ); } - console.log('getIBCConnectionsClientState', clientState.value); }); chainStore.rpc.getIBCConnectionsChannels(connId.value).then((x) => { channels.value = x.channels; @@ -426,13 +426,15 @@ function color(v: string) { - {{ format.toLocaleDate(resp.timestamp) }} + + {{ resp.timestamp ? format.toLocaleDate(resp.timestamp) : '-' }} + diff --git a/src/stores/useFormatter.ts b/src/stores/useFormatter.ts index 8acaa30f..3ddbf62a 100644 --- a/src/stores/useFormatter.ts +++ b/src/stores/useFormatter.ts @@ -366,10 +366,12 @@ export const useFormatter = defineStore('formatter', { }, toLocaleDate(time?: string | number | Date | Timestamp) { if (!time) return ''; + const timeValue = typeof time === 'object' && 'seconds' in time ? fromTimestamp(time) : time; + return new Date(timeValue).toLocaleString(navigator.language); }, toDay(time?: string | number | Date | Timestamp, format = 'long') {