fix chainid

This commit is contained in:
Pham Tu 2024-01-18 11:10:11 +07:00
parent 09ce8dbfa3
commit c8beacc0d2
No known key found for this signature in database
GPG Key ID: 7460FD99133ADA1C

View File

@ -17,9 +17,10 @@ function changeEndpoint(item: Endpoint) {
<div class="p-1 relative mr-3 cursor-pointer">
<img v-lazy="chainStore.logo" class="w-9 h-9 rounded-full" />
<div
class="w-2 h-2 rounded-full absolute right-0 bottom-0 shadow" :class="{
class="w-2 h-2 rounded-full absolute right-0 bottom-0 shadow"
:class="{
'bg-success': baseStore.connected,
'bg-error': !baseStore.connected
'bg-error': !baseStore.connected,
}"
></div>
</div>
@ -32,11 +33,14 @@ function changeEndpoint(item: Endpoint) {
"
class="capitalize whitespace-nowrap text-base font-semibold text-gray-600 dark:text-gray-200 hidden md:!block"
>
{{
{{
baseStore.latest?.block?.header?.height
? `#${baseStore.latest.block.header.height}`
: chainStore.chainName || ''
}} <span class="text-error">{{ baseStore.connected ? '' : 'disconnected' }}</span>
: chainStore.chainName || ''
}}
<span class="text-error">{{
baseStore.connected ? '' : 'disconnected'
}}</span>
</div>
<div
class="text-xs text-gray-500 dark:text-gray-400 whitespace-nowrap hidden md:!block"
@ -52,12 +56,12 @@ function changeEndpoint(item: Endpoint) {
<!-- rest -->
<div
class="px-4 py-2 text-sm text-gray-400"
v-if="chainStore.current?.endpoints?.rest"
v-if="chainStore.current?.endpoints?.rpc"
>
Rest Endpoint
</div>
<div
v-for="(item, index) in chainStore.current?.endpoints?.rest"
v-for="(item, index) in chainStore.current?.endpoints?.rpc"
class="px-4 py-2 w-full hover:bg-gray-100 dark:hover:bg-[#384059] cursor-pointer"
:key="index"
@click="changeEndpoint(item)"
@ -82,14 +86,20 @@ function changeEndpoint(item: Endpoint) {
<div class="px-4 py-2 text-sm text-gray-400">Information</div>
<div class="w-full">
<div class="py-2 px-4">
Chain Id: {{ baseStore.latest.block?.header.chain_id && baseStore.connected
? baseStore.latest.block.header.chain_id
: 'N/A' }}
Chain Id:
{{
baseStore.latest.block?.header.chainId && baseStore.connected
? baseStore.latest.block.header.chainId
: 'N/A'
}}
</div>
<div class="py-2 px-4">
Height: {{ baseStore.latest.block?.header.height && baseStore.connected
? baseStore.latest.block.header.height
: '0' }}
Height:
{{
baseStore.latest.block?.header.height && baseStore.connected
? baseStore.latest.block.header.height
: '0'
}}
</div>
</div>
<!-- bottom-->