Skip to content

Commit

Permalink
fix: Add pause status for wallet sync
Browse files Browse the repository at this point in the history
  • Loading branch information
yanguoyu committed Jun 1, 2024
1 parent c827818 commit 86a74d7
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface DAORecordProps extends State.NervosDAORecord {
depositEpoch: string // deposit epoch string
currentEpoch: string // current epoch string
withdrawCapacity: string | null // capacity that is available for withdraw
connectionStatus: 'online' | 'offline' | 'connecting' // connection status
connectionStatus: State.ConnectionStatus // connection status
onClick: React.EventHandler<React.MouseEvent> // on action button click
tipBlockTimestamp: number // tip block timestamp, used to calculate apc, dovetails with current epoch
genesisBlockTimestamp: number | undefined // genesis block timestamp, used to calculate apc
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/components/PageContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const PageContainer: React.FC<ComponentProps> = props => {
<div className={styles.syncStatus}>
<SyncStatusComponent
syncStatus={syncStatus}
connectionStatus={isOpenMultisigWithLight ? 'offline' : connectionStatus}
connectionStatus={isOpenMultisigWithLight ? 'pause' : connectionStatus}
syncPercents={syncPercents}
syncBlockNumbers={syncBlockNumbers}
isLookingValidTarget={isLookingValidTarget}
Expand Down
4 changes: 4 additions & 0 deletions packages/neuron-ui/src/components/SyncStatus/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ const SyncStatus = ({
return <span>{t('navbar.connecting')}</span>
}

if (ConnectionStatus.Pause === connectionStatus) {
return <span>{t('navbar.pause')}</span>
}

if (ConnectionStatus.Offline === connectionStatus) {
return (
<span className={styles.redDot}>
Expand Down
1 change: 1 addition & 0 deletions packages/neuron-ui/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"special-assets": "Customized Assets",
"sync-not-start": "Sync not started yet",
"connecting": "Connecting",
"pause": "Sync paused",
"experimental-functions": "Experimental",
"s-udt": "Asset Accounts",
"update-neuron-with-ckb": "The version of the CKB node does not match Neuron (v{{ version }}), which may cause compatibility issues. Please update to the latest version of Neuron.",
Expand Down
1 change: 1 addition & 0 deletions packages/neuron-ui/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"special-assets": "Activos personalizados",
"sync-not-start": "Sincronización no iniciada aún",
"connecting": "Conectando",
"pause": "Pausar sincronización",
"experimental-functions": "Experimental",
"s-udt": "Cuentas de activos",
"update-neuron-with-ckb": "La versión del nodo de CKB no coincide con Neuron (v{{ version }}), lo que puede causar problemas de compatibilidad. Por favor actualice a la última versión de Neuron.",
Expand Down
1 change: 1 addition & 0 deletions packages/neuron-ui/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"special-assets": "Actifs personnalisés",
"sync-not-start": "Synchronisation pas encore démarrée",
"connecting": "Connexion",
"pause": "Pause synchronisation",
"experimental-functions": "Expérimental",
"s-udt": "Comptes d'actifs",
"update-neuron-with-ckb": "La version du noeud CKB ne correspond pas à Neuron (v{{ version }}), ce qui peut entraîner des problèmes de compatibilité. Veuillez mettre à jour vers la dernière version de Neuron.",
Expand Down
1 change: 1 addition & 0 deletions packages/neuron-ui/src/locales/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"special-assets": "自定義資產",
"sync-not-start": "同步尚未開始",
"connecting": "正在連接節點",
"pause": "同步暫停",
"experimental-functions": "實驗性功能",
"s-udt": "資產賬戶",
"update-neuron-with-ckb": "CKB 節點版本與 Neuron (v{{ version }}) 不匹配,可能導致兼容性問題。請更新到最新版 Neuron。",
Expand Down
1 change: 1 addition & 0 deletions packages/neuron-ui/src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"special-assets": "自定义资产",
"sync-not-start": "同步尚未开始",
"connecting": "正在连接节点",
"pause": "同步暂停",
"experimental-functions": "实验性功能",
"s-udt": "资产账户",
"update-neuron-with-ckb": "CKB 节点版本与 Neuron (v{{ version }}) 不匹配,可能导致兼容性问题。请更新到最新版 Neuron。",
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/types/App/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ declare namespace State {
balance: string
addresses: Address[]
}
type ConnectionStatus = 'online' | 'offline' | 'connecting'
type ConnectionStatus = 'online' | 'offline' | 'connecting' | 'pause'

type SyncState = Readonly<{
cacheTipBlockNumber: number
Expand Down
2 changes: 2 additions & 0 deletions packages/neuron-ui/src/utils/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ export enum ConnectionStatus {
Online = 'online',
Offline = 'offline',
Connecting = 'connecting',
// pasue by open multisig address with light client
Pause = 'pause',
}

export enum RoutePath {
Expand Down

1 comment on commit 86a74d7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Packaging for test is done in 9331109868

Please sign in to comment.