Fix syncing status and change api for scrt.network

This commit is contained in:
liangping 2021-09-21 17:26:22 +08:00
parent 2d111e9d8a
commit 91101648fc
3 changed files with 4 additions and 3 deletions

View File

@ -145,7 +145,8 @@ export function toDuration(value) {
// unit(y M d h m s ms)
export function timeIn(time, amount, unit = 's') {
return dayjs().isAfter(dayjs(time).add(amount, unit))
const input = dayjs(time).add(amount, unit)
return dayjs().unix() > input.unix()
}
export function toDay(time, format = 'long') {

View File

@ -1,6 +1,6 @@
{
"chain_name": "secret",
"api": "https://beta-api.scrt.network",
"api": "https://api.scrt.network",
"sdk_version": "0.33.8",
"addr_prefix": "secret",
"logo": "https://dl.airtable.com/.attachments/b95ce1905e5327924ffdcb6d57c55b66/7e2ad353/logo.png"

View File

@ -165,7 +165,7 @@ export default {
const { header } = b.block
this.$set(chain, 'height', header.height)
this.$set(chain, 'time', toDay(header.time))
this.$set(chain, 'variant', timeIn(header, 1, 'm') ? 'danger' : 'success')
this.$set(chain, 'variant', timeIn(header.time, 3, 'm') ? 'danger' : 'success')
})
}
})