Skip to content

Commit

Permalink
fix bug cause clear commitments
Browse files Browse the repository at this point in the history
  • Loading branch information
vorujack committed Apr 1, 2024
1 parent 86a9f54 commit 6282f7e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/action/multi-sig/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ const storeMultiSigRow = async (
}
return row;
};

export {
multiSigStoreNewTx,
fetchMultiSigRows,
Expand Down
5 changes: 1 addition & 4 deletions src/hooks/useInitConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ const useInitConfig = () => {
activeWallet: -1,
};
configs.forEach((item) => {
if (
item.key === ConfigType.DisplayMode &&
item.value === 'simple'
) {
if (item.key === ConfigType.DisplayMode && item.value === 'simple') {
config.display = 'simple';
} else if (item.key === ConfigType.Currency) {
config.currency = item.value;
Expand Down
7 changes: 6 additions & 1 deletion src/pages/wallet-page/multi-sig/MultiSigCommunication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useContext, useEffect, useState } from 'react';
import { useSelector } from 'react-redux';
import {
fetchMultiSigBriefRow,
fetchMultiSigRows,
notAvailableAddresses,
storeMultiSigRow,
} from '@/action/multi-sig/store';
Expand Down Expand Up @@ -65,12 +66,16 @@ const MultiSigCommunication = (props: MultiSigCommunicationPropsType) => {
boxes,
);
if (invalidAddresses.length === 0) {
const oldRow = await fetchMultiSigRows(props.wallet, [
tx.unsigned_tx().id().to_str(),
]);
const secrets = oldRow.length > 0 ? oldRow[0].secrets : [[]];
const row = await storeMultiSigRow(
props.wallet,
tx,
boxes,
data.commitments,
[[]],
secrets,
data.signed || [],
data.simulated || [],
Date.now(),
Expand Down

0 comments on commit 6282f7e

Please sign in to comment.