Skip to content

Commit eb7e183

Browse files
committed
fix
1 parent 8233973 commit eb7e183

File tree

4 files changed

+23
-27
lines changed

4 files changed

+23
-27
lines changed

packages/neuron-ui/src/components/MultisigAddress/index.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
useClearGeneratedTx,
1111
} from 'utils'
1212
import appState from 'states/init/app'
13-
import { useState as useGlobalState, useDispatch, showPageNotice } from 'states'
13+
import { useState as useGlobalState, useDispatch } from 'states'
1414
import MultisigAddressCreateDialog from 'components/MultisigAddressCreateDialog'
1515
import MultisigAddressInfo from 'components/MultisigAddressInfo'
1616
import SendFromMultisigDialog from 'components/SendFromMultisigDialog'
@@ -21,6 +21,7 @@ import MultisigAddressNervosDAODialog from 'components/MultisigAddressNervosDAOD
2121
import Dialog from 'widgets/Dialog'
2222
import Table from 'widgets/Table'
2323
import Tooltip from 'widgets/Tooltip'
24+
import Toast from 'widgets/Toast'
2425
import AlertDialog from 'widgets/AlertDialog'
2526
import {
2627
Download,
@@ -151,6 +152,7 @@ const MultisigAddress = () => {
151152
const dispatch = useDispatch()
152153
const [globalAPC, setGlobalAPC] = useState(0)
153154
const [genesisBlockTimestamp, setGenesisBlockTimestamp] = useState<number | undefined>(undefined)
155+
const [notice, setNotice] = useState('')
154156

155157
const onClickItem = useCallback(
156158
(multisigConfig: MultisigConfig) => (e: React.SyntheticEvent<HTMLButtonElement>) => {
@@ -270,8 +272,11 @@ const MultisigAddress = () => {
270272

271273
const onDepositSuccess = useCallback(() => {
272274
daoDepositAction.closeDialog()
273-
showPageNotice('nervos-dao.deposit-submitted')(dispatch)
274-
}, [dispatch, daoDepositAction.closeDialog])
275+
setNotice(t('nervos-dao.deposit-submitted'))
276+
if (daoDepositAction.depositFromMultisig) {
277+
daoWithdrawAction.action(daoDepositAction.depositFromMultisig)
278+
}
279+
}, [t, setNotice, daoDepositAction, daoWithdrawAction])
275280

276281
return (
277282
<div>
@@ -488,6 +493,8 @@ const MultisigAddress = () => {
488493
noDataContent={t('multisig-address.no-data')}
489494
/>
490495
</div>
496+
497+
<Toast content={notice} onDismiss={() => setNotice('')} />
491498
</div>
492499
</Dialog>
493500

packages/neuron-ui/src/components/NervosDAORecord/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export const DAORecord = ({
217217
<Button
218218
className={styles.txRecordBtn}
219219
onClick={() => {
220-
openExternal(`${getExplorerUrl(isMainnet)}/transaction/${depositOutPoint?.txHash}`)
220+
openExternal(`${getExplorerUrl(isMainnet)}/transaction/${txHash}`)
221221
}}
222222
type="default"
223223
label={t('nervos-dao.deposit-record.view-tx-detail')}

packages/neuron-ui/src/components/PasswordRequest/hooks.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ export default ({
152152
await sendTransaction({ walletID, tx: generatedTx, description, password, multisigConfig })(dispatch).then(
153153
(res: { result?: string; status: number; message: string | { content: string } }) => {
154154
if (isSuccessResponse(res)) {
155-
requestOpenInExplorer({ type: 'transaction', key: res.result })
155+
if (onSuccess) {
156+
onSuccess()
157+
} else {
158+
requestOpenInExplorer({ type: 'transaction', key: res.result })
159+
}
156160
} else if (res.status === ErrorCode.PasswordIncorrect) {
157161
throw new PasswordIncorrectException()
158162
} else {

packages/neuron-wallet/src/services/cells.ts

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,7 @@ export default class CellsService {
229229
.createQueryBuilder('output')
230230
.leftJoinAndSelect('output.transaction', 'tx')
231231
.where(
232-
lockArgs
233-
? `
234-
output.daoData IS NOT NULL AND
235-
output.lockArgs = :lockArgs AND
232+
`output.daoData IS NOT NULL AND
236233
(
237234
output.status = :liveStatus OR
238235
output.status = :sentStatus OR
@@ -244,26 +241,14 @@ export default class CellsService {
244241
) AND
245242
output.depositTxHash is not null
246243
)
247-
)`
248-
: `
249-
output.daoData IS NOT NULL AND
250-
(
251-
output.status = :liveStatus OR
252-
output.status = :sentStatus OR
253-
tx.status = :failedStatus OR
254-
(
255-
(
256-
output.status = :deadStatus OR
257-
output.status = :pendingStatus
258-
) AND
259-
output.depositTxHash is not null
260-
)
261-
) AND
262-
output.lockArgs in (
244+
) AND ${
245+
lockArgs
246+
? `output.lockArgs = :lockArgs`
247+
: `output.lockArgs in (
263248
SELECT publicKeyInBlake160
264249
FROM hd_public_key_info
265-
WHERE walletId = :walletId
266-
)`,
250+
WHERE walletId = :walletId)`
251+
}`,
267252
{
268253
walletId,
269254
lockArgs,

0 commit comments

Comments
 (0)