Skip to content

Commit

Permalink
feat(neuron-ui): update the epoch index
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY committed Oct 11, 2019
1 parent 9de23cc commit 7599cb7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/components/History/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useEffect } from 'react'
import { updateTransactionList } from 'states/stateProvider/actionCreators/transactions'
import { queryParsers } from 'utils/parser'
import { queryParsers } from 'utils/parsers'
import { backToTop } from 'utils/animations'

export const useSearch = (search: string = '', walletID: string = '', dispatch: React.Dispatch<any>) => {
Expand Down
3 changes: 2 additions & 1 deletion packages/neuron-ui/src/components/Overview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { updateTransactionList } from 'states/stateProvider/actionCreators'
import { showTransactionDetails } from 'services/remote'

import { localNumberFormatter, shannonToCKBFormatter, uniformTimeFormatter as timeFormatter } from 'utils/formatters'
import { epochParser } from 'utils/parsers'
import { PAGE_SIZE, Routes, CONFIRMATION_THRESHOLD } from 'utils/const'
import { backToTop } from 'utils/animations'

Expand Down Expand Up @@ -250,7 +251,7 @@ const Overview = ({
},
{
label: t('overview.epoch'),
value: epoch,
value: epochParser(epoch).index,
},
{
label: t('overview.difficulty'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ export const prompt = (search: string) => {
}
export const queryParsers = { history, prompt }

export default { queryParsers }
/* eslint-disable no-bitwise */
export const epochParser = (epoch: string) => {
return {
index: +epoch & 0xffff,
}
}
/* eslint-enable no-bitwise */

export default { queryParsers, epochParser }

0 comments on commit 7599cb7

Please sign in to comment.