Skip to content

Commit

Permalink
fix: [ADN-410] Fix an error of Approve Transaction popup
Browse files Browse the repository at this point in the history
  • Loading branch information
jinoosss committed Jan 31, 2024
1 parent 91da274 commit 78c37c5
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,15 @@ const ApproveTransactionContainer: React.FC = () => {

try {
setProcessType('PROCESSING');
const { signed } = await transactionService.createTransaction(wallet, document);
const walletInstance = wallet.clone();
walletInstance.currentAccountId = currentAccount.id;
const { signed } = await transactionService.createTransaction(walletInstance, document);
const hash = transactionService.createHash(signed);
const response = await new Promise<
BroadcastTxCommitResult | BroadcastTxSyncResult | TM2Error | null
>((resolve) => {
transactionService
.sendTransaction(wallet, currentAccount, signed, true)
.sendTransaction(walletInstance, currentAccount, signed, true)
.then(resolve)
.catch((error: TM2Error | Error) => {
resolve(error);
Expand Down Expand Up @@ -261,7 +263,7 @@ const ApproveTransactionContainer: React.FC = () => {
});
return;
}
sendTransaction().finally(() => setProcessType('DONE'));
sendTransaction().finally(() => { setProcessType('DONE') });
};

useEffect(() => {
Expand Down Expand Up @@ -297,7 +299,7 @@ const ApproveTransactionContainer: React.FC = () => {

const onResponseSendTransaction = useCallback(() => {
if (response) {
// chrome.runtime.sendMessage(response);
chrome.runtime.sendMessage(response);
}
}, [response]);

Expand Down

0 comments on commit 78c37c5

Please sign in to comment.