Skip to content

Commit

Permalink
fix(dw): safe (#2798)
Browse files Browse the repository at this point in the history
  • Loading branch information
javadkh2 authored Jan 16, 2025
1 parent 54b0802 commit fcf2be7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
IClient,
ICommand,
IPactCommand,
isSignedTransaction,
ITransactionDescriptor,
IUnsignedCommand,
} from '@kadena/client';
Expand Down Expand Up @@ -61,6 +62,16 @@ export async function syncTransactionStatus(
) {
return tx;
}
if (tx.status === 'initiated') {
if (isSignedTransaction(tx)) {
const updatedTx: ITransaction = {
...tx,
status: 'signed',
};
await transactionRepository.updateTransaction(updatedTx);
return syncTransactionStatus(updatedTx, client);
}
}
if (
tx.status === 'signed' ||
tx.status === 'preflight' ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ import {
IPactCommand,
IPartialPactCommand,
ISigningRequest,
isSignedTransaction,
IUnsignedCommand,
} from '@kadena/client';

import { SideBarBreadcrumbs } from '@/Components/SideBarBreadcrumbs/SideBarBreadcrumbs';
import { transactionRepository } from '@/modules/transaction/transaction.repository';
import {
ITransaction,
transactionRepository,
} from '@/modules/transaction/transaction.repository';
import * as transactionService from '@/modules/transaction/transaction.service';
import { useWallet } from '@/modules/wallet/wallet.hook';
import { normalizeTx } from '@/utils/normalizeSigs';
Expand Down Expand Up @@ -165,7 +169,11 @@ export function SignatureBuilder() {
await transactionRepository.updateTransaction({
...tx,
sigs: updatedTx.sigs,
});
status:
tx.status === 'initiated' && isSignedTransaction(updatedTx)
? 'signed'
: tx.status,
} as ITransaction);
}
navigate(`/transaction/${tx.uuid}`);
return;
Expand Down

0 comments on commit fcf2be7

Please sign in to comment.