Skip to content

Commit 7599cb7

Browse files
committed
feat(neuron-ui): update the epoch index
1 parent 9de23cc commit 7599cb7

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

packages/neuron-ui/src/components/History/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useState, useEffect } from 'react'
22
import { updateTransactionList } from 'states/stateProvider/actionCreators/transactions'
3-
import { queryParsers } from 'utils/parser'
3+
import { queryParsers } from 'utils/parsers'
44
import { backToTop } from 'utils/animations'
55

66
export const useSearch = (search: string = '', walletID: string = '', dispatch: React.Dispatch<any>) => {

packages/neuron-ui/src/components/Overview/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { updateTransactionList } from 'states/stateProvider/actionCreators'
2626
import { showTransactionDetails } from 'services/remote'
2727

2828
import { localNumberFormatter, shannonToCKBFormatter, uniformTimeFormatter as timeFormatter } from 'utils/formatters'
29+
import { epochParser } from 'utils/parsers'
2930
import { PAGE_SIZE, Routes, CONFIRMATION_THRESHOLD } from 'utils/const'
3031
import { backToTop } from 'utils/animations'
3132

@@ -250,7 +251,7 @@ const Overview = ({
250251
},
251252
{
252253
label: t('overview.epoch'),
253-
value: epoch,
254+
value: epochParser(epoch).index,
254255
},
255256
{
256257
label: t('overview.difficulty'),
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,12 @@ export const prompt = (search: string) => {
2323
}
2424
export const queryParsers = { history, prompt }
2525

26-
export default { queryParsers }
26+
/* eslint-disable no-bitwise */
27+
export const epochParser = (epoch: string) => {
28+
return {
29+
index: +epoch & 0xffff,
30+
}
31+
}
32+
/* eslint-enable no-bitwise */
33+
34+
export default { queryParsers, epochParser }

0 commit comments

Comments
 (0)