From b3f3c2ec64de9f6dbbff4751e0956bdab05eb56f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E5=9B=BD=E5=AE=87?= <841185308@qq.com> Date: Mon, 9 Oct 2023 09:37:11 +0800 Subject: [PATCH] fix: fixed locktime cell,multisig sync blocknumber, table head style (#2860) * fix: Lock time cells should save into local database. * fix: For light client only skip update if not current wallet. Fixed table head style. * fix: If not enter start block number, disabled sumbit. * fix: Fix asset send styles, dialog style and enable enter signature --- .../src/components/PageContainer/index.tsx | 1 + .../src/components/SUDTSend/index.tsx | 6 ++++-- .../components/SUDTSend/sUDTSend.module.scss | 18 ++++++++++++++++-- .../src/components/SignAndVerify/index.tsx | 1 - .../src/widgets/Dialog/dialog.module.scss | 6 +----- .../src/widgets/Table/table.module.scss | 2 +- .../neuron-wallet/src/services/multisig.ts | 2 +- .../src/services/tx/transaction-persistor.ts | 13 +++++++------ 8 files changed, 31 insertions(+), 18 deletions(-) diff --git a/packages/neuron-ui/src/components/PageContainer/index.tsx b/packages/neuron-ui/src/components/PageContainer/index.tsx index 1b7757d605..3c1243bf38 100755 --- a/packages/neuron-ui/src/components/PageContainer/index.tsx +++ b/packages/neuron-ui/src/components/PageContainer/index.tsx @@ -151,6 +151,7 @@ const PageContainer: React.FC = props => { show={isSetStartBlockShown} onCancel={closeDialog} onConfirm={onConfirm} + disabled={!startBlockNumber} >

{t('set-start-block-number.tip')}

{
-
+
{accountInfo?.accountName}
{displayTokenName}
- {showBalance ? balance : HIDE_BALANCE} {displaySymbol} + + {showBalance ? balance : HIDE_BALANCE} {displaySymbol} + diff --git a/packages/neuron-ui/src/components/SUDTSend/sUDTSend.module.scss b/packages/neuron-ui/src/components/SUDTSend/sUDTSend.module.scss index 865fff309f..0df08c4cff 100644 --- a/packages/neuron-ui/src/components/SUDTSend/sUDTSend.module.scss +++ b/packages/neuron-ui/src/components/SUDTSend/sUDTSend.module.scss @@ -20,12 +20,15 @@ $bottomHeight: 186px; } } +$right-min-width: 476px; + .layout { display: flex; .left { flex: 1; position: relative; + max-width: calc(100% - $right-min-width); .info { padding: 20px 16px 16px; @@ -33,6 +36,9 @@ $bottomHeight: 186px; display: flex; gap: 16px; color: var(--main-text-color); + .infoDetails { + max-width: calc(100% - 48px); + } .accountName { font-weight: 500; font-size: 14px; @@ -42,10 +48,9 @@ $bottomHeight: 186px; margin-top: 4px; font-size: 12px; line-height: 17px; - overflow: initial !important; position: relative; color: var(--input-second-color); - display: inline-flex; + @include text-overflow-ellipsis; } .balance { margin-top: 8px; @@ -54,10 +59,14 @@ $bottomHeight: 186px; line-height: 22px; display: flex; align-items: center; + & > span { + @include text-overflow-ellipsis; + } .btn { height: 16px; min-width: 16px; padding: 0 8px; + flex-shrink: 0; svg { g, path { @@ -106,6 +115,10 @@ $bottomHeight: 186px; } .amount { margin-top: 20px; + + & > label { + @include text-overflow-ellipsis; + } } .max { border-left: var(--divide-line-color) solid 1px; @@ -162,6 +175,7 @@ $bottomHeight: 186px; .right { margin-left: 16px; flex: 1; + min-width: $right-min-width; @include card; .rightContent { diff --git a/packages/neuron-ui/src/components/SignAndVerify/index.tsx b/packages/neuron-ui/src/components/SignAndVerify/index.tsx index 43b54bb315..d8cd73ea1d 100644 --- a/packages/neuron-ui/src/components/SignAndVerify/index.tsx +++ b/packages/neuron-ui/src/components/SignAndVerify/index.tsx @@ -316,7 +316,6 @@ const SignAndVerify = () => { field="signature" value={signature} onChange={handleInputChange} - disabled={!signature} width="100%" /> diff --git a/packages/neuron-ui/src/widgets/Dialog/dialog.module.scss b/packages/neuron-ui/src/widgets/Dialog/dialog.module.scss index 418650c777..e18b0d40e4 100644 --- a/packages/neuron-ui/src/widgets/Dialog/dialog.module.scss +++ b/packages/neuron-ui/src/widgets/Dialog/dialog.module.scss @@ -48,12 +48,8 @@ .content { padding: 20px 16px; position: relative; - max-height: calc(90vh); + max-height: calc(100vh - 260px); overflow-y: scroll; - scrollbar-width: none; - &::-webkit-scrollbar { - display: none; - } } .footerWrap { diff --git a/packages/neuron-ui/src/widgets/Table/table.module.scss b/packages/neuron-ui/src/widgets/Table/table.module.scss index c39a8aefd1..eb9fc5d35d 100755 --- a/packages/neuron-ui/src/widgets/Table/table.module.scss +++ b/packages/neuron-ui/src/widgets/Table/table.module.scss @@ -34,7 +34,7 @@ $head-height: 52px; border-top: 1px solid var(--table-head-border-color); border-bottom: 1px solid var(--table-head-border-color); - & > .headWithBalance { + .headWithBalance { display: flex; align-items: center; } diff --git a/packages/neuron-wallet/src/services/multisig.ts b/packages/neuron-wallet/src/services/multisig.ts index 40397f617a..922fbf7161 100644 --- a/packages/neuron-wallet/src/services/multisig.ts +++ b/packages/neuron-wallet/src/services/multisig.ts @@ -279,7 +279,7 @@ export default class MultisigService { multisigConfigs.map(v => { const blockNumber = syncBlockNumbersMap[scriptToHash(Multisig.getMultisigScript(v.blake160s, v.r, v.m, v.n))] - v.lastestBlockNumber = `0x${BigInt(blockNumber).toString(16)}` + v.lastestBlockNumber = `0x${BigInt(blockNumber ?? v.lastestBlockNumber).toString(16)}` return v }) ) diff --git a/packages/neuron-wallet/src/services/tx/transaction-persistor.ts b/packages/neuron-wallet/src/services/tx/transaction-persistor.ts index 9a8b1dc88e..05a2d8203c 100644 --- a/packages/neuron-wallet/src/services/tx/transaction-persistor.ts +++ b/packages/neuron-wallet/src/services/tx/transaction-persistor.ts @@ -400,12 +400,13 @@ export class TransactionPersistor { private static shouldSaveDetail(cell: InputEntity | OutputEntity, lockArgsSetNeedsDetail: Set) { return ( - cell.lockArgs && - (lockArgsSetNeedsDetail.has(cell.lockArgs) || - (cell.lockArgs.length === CHEQUE_ARGS_LENGTH && - [cell.lockArgs.slice(0, DEFAULT_ARGS_LENGTH), `0x${cell.lockArgs.slice(DEFAULT_ARGS_LENGTH)}`].some(v => - lockArgsSetNeedsDetail.has(v) - ))) + (cell.multiSignBlake160 && lockArgsSetNeedsDetail.has(cell.multiSignBlake160)) || + (cell.lockArgs && + (lockArgsSetNeedsDetail.has(cell.lockArgs) || + (cell.lockArgs.length === CHEQUE_ARGS_LENGTH && + [cell.lockArgs.slice(0, DEFAULT_ARGS_LENGTH), `0x${cell.lockArgs.slice(DEFAULT_ARGS_LENGTH)}`].some(v => + lockArgsSetNeedsDetail.has(v) + )))) ) }