Skip to content

Commit

Permalink
feat(neuron-ui): add hint for synchronization not started.
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY committed Nov 15, 2019
1 parent aba7ee5 commit 7d0cc67
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/neuron-ui/src/containers/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export const SyncStatus = ({
return <Text variant="xSmall">{t('footer.fail-to-fetch-tip-block-number')}</Text>
}

if (+syncedBlockNumber < 0) {
return <Text variant="xSmall">{t('footer.sync-not-start')}</Text>
}

const percentage = +syncedBlockNumber / +tipBlockNumber

return +syncedBlockNumber + bufferBlockNumber < +tipBlockNumber ? (
Expand Down
3 changes: 2 additions & 1 deletion packages/neuron-ui/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@
"save": "Save image"
},
"footer": {
"fail-to-fetch-tip-block-number": "Cannot fetch tip block number"
"fail-to-fetch-tip-block-number": "Cannot fetch tip block number",
"sync-not-start": "Synchronization not started yet"
},
"common": {
"or": "or",
Expand Down
3 changes: 2 additions & 1 deletion packages/neuron-ui/src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@
"save": "保存图片"
},
"footer": {
"fail-to-fetch-tip-block-number": "无法获取最新高度"
"fail-to-fetch-tip-block-number": "无法获取最新高度",
"sync-not-start": "同步尚未开始"
},
"common": {
"or": "",
Expand Down

0 comments on commit 7d0cc67

Please sign in to comment.