diff --git a/packages/neuron-ui/src/components/History/index.tsx b/packages/neuron-ui/src/components/History/index.tsx index cdc4096d37..7f47224faa 100644 --- a/packages/neuron-ui/src/components/History/index.tsx +++ b/packages/neuron-ui/src/components/History/index.tsx @@ -60,15 +60,14 @@ const groupHistory = (items: Transaction[]): Transaction[][] => { }, []) } -const History = (props: React.PropsWithoutRef) => { - const { - location: { search, pathname }, - history, - loadings, - errorMsgs, - dispatch, - providerDispatch, - } = props +const History = ({ + location: { search, pathname }, + history, + // loadings, + errorMsgs, + dispatch, + providerDispatch, +}: React.PropsWithoutRef) => { const { chain: { transactions: { pageNo, pageSize, totalCount, items, addresses }, @@ -82,20 +81,20 @@ const History = (props: React.PropsWithoutRefLoading - } - return (

{t('siderbar.history')}

{errorMsgs.transaction ? {t(`messages.${errorMsgs.transactions}`)} : null} - {addresses.map(address => ( - - {address} - - - ))} + {addresses.length > 0 ? ( + addresses.map(address => ( + + {address} + + + )) + ) : ( +
No Transactions Found
+ )} {groupHistory(items).map(group => ( @@ -129,11 +128,13 @@ const History = (props: React.PropsWithoutRef ))} - - - - - + {addresses.length > 0 ? ( + + + + + + ) : null} ) } diff --git a/packages/neuron-ui/src/components/Receive/index.tsx b/packages/neuron-ui/src/components/Receive/index.tsx index 9d10e863bc..2f1842e9b4 100644 --- a/packages/neuron-ui/src/components/Receive/index.tsx +++ b/packages/neuron-ui/src/components/Receive/index.tsx @@ -50,7 +50,7 @@ const Receive = (props: React.PropsWithoutRef{t('receive.address-not-found')} } const copyAddress = () => { diff --git a/packages/neuron-ui/src/components/WalletWizard/index.tsx b/packages/neuron-ui/src/components/WalletWizard/index.tsx index 0b6066455e..d285d421e1 100644 --- a/packages/neuron-ui/src/components/WalletWizard/index.tsx +++ b/packages/neuron-ui/src/components/WalletWizard/index.tsx @@ -84,6 +84,11 @@ const Mnemonic = ({ }) // TODO: Better Error Handle .catch(err => console.error(err)) + } else { + dispatch({ + type: 'imported', + payload: '', + }) } }, [dispatch, type]) @@ -139,6 +144,14 @@ const Submission = ({ type: 'name', payload: `wallet @${Math.round(Math.random() * 100)}`, }) + dispatch({ + type: 'password', + payload: '', + }) + dispatch({ + type: 'confirmPassword', + payload: '', + }) }, [dispatch]) const onChange = useCallback( diff --git a/packages/neuron-ui/src/containers/Providers/hooks.ts b/packages/neuron-ui/src/containers/Providers/hooks.ts index 83a720717a..898578e11e 100644 --- a/packages/neuron-ui/src/containers/Providers/hooks.ts +++ b/packages/neuron-ui/src/containers/Providers/hooks.ts @@ -54,7 +54,7 @@ export const useChannelListeners = (i18n: any, chain: any, dispatch: React.Dispa UILayer.on(Channel.Transactions, (_e: Event, method: TransactionsMethod, args: ChannelResponse) => { if (args.status) { switch (method) { - case TransactionsMethod.GetAll: { + case TransactionsMethod.GetAllByAddresses: { dispatch({ type: ProviderActions.Chain, payload: { transactions: { ...chain.transactions, ...args.result } }, diff --git a/packages/neuron-ui/src/locales/en.json b/packages/neuron-ui/src/locales/en.json index 04a46e2f39..a465fcd943 100644 --- a/packages/neuron-ui/src/locales/en.json +++ b/packages/neuron-ui/src/locales/en.json @@ -31,6 +31,9 @@ "this-transfer-will-send": "This transfer will send", "scan-to-get-address": "scan the qrcode to get address" }, + "receive": { + "address-not-found": "Address not found" + }, "history": { "meta": "meta", "type": "type", diff --git a/packages/neuron-ui/src/locales/zh.json b/packages/neuron-ui/src/locales/zh.json index 2cc1d26c39..e13eb05ce9 100644 --- a/packages/neuron-ui/src/locales/zh.json +++ b/packages/neuron-ui/src/locales/zh.json @@ -31,6 +31,9 @@ "this-transfer-will-send": "本次交易将发送", "scan-to-get-address": "扫码二维码以获取地址" }, + "receive": { + "address-not-found": "未找到地址" + }, "history": { "meta": "元信息", "type": "类型", diff --git a/packages/neuron-ui/src/utils/parser.ts b/packages/neuron-ui/src/utils/parser.ts index 31407c2365..f33f89a163 100644 --- a/packages/neuron-ui/src/utils/parser.ts +++ b/packages/neuron-ui/src/utils/parser.ts @@ -5,7 +5,7 @@ export const history = (search: string) => { const addresses = query.get('addresses') // use Object.fromEntries in ES10 const params = { - pageNo: +(query.get('pageNo') || 0), + pageNo: +(query.get('pageNo') || 1), pageSize: +(query.get('pageSize') || PAGE_SIZE), addresses: addresses ? addresses.split(',') : [], } diff --git a/packages/neuron-wallet/src/controllers/transactions.ts b/packages/neuron-wallet/src/controllers/transactions.ts index 3ba1421f85..3612b3cd73 100644 --- a/packages/neuron-wallet/src/controllers/transactions.ts +++ b/packages/neuron-wallet/src/controllers/transactions.ts @@ -35,7 +35,7 @@ export default class TransactionsController { if (transactions) { return { status: ResponseCode.Success, - result: transactions, + result: { ...params, ...transactions }, } } return {