diff --git a/packages/apps/dev-wallet/src/modules/transaction/transaction.service.ts b/packages/apps/dev-wallet/src/modules/transaction/transaction.service.ts index b0db1a6e79..ab82c31d2a 100644 --- a/packages/apps/dev-wallet/src/modules/transaction/transaction.service.ts +++ b/packages/apps/dev-wallet/src/modules/transaction/transaction.service.ts @@ -4,6 +4,7 @@ import { IClient, ICommand, IPactCommand, + isSignedTransaction, ITransactionDescriptor, IUnsignedCommand, } from '@kadena/client'; @@ -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' || diff --git a/packages/apps/dev-wallet/src/pages/signature-builder/signature-builder.tsx b/packages/apps/dev-wallet/src/pages/signature-builder/signature-builder.tsx index 900f74eae9..7168c78229 100644 --- a/packages/apps/dev-wallet/src/pages/signature-builder/signature-builder.tsx +++ b/packages/apps/dev-wallet/src/pages/signature-builder/signature-builder.tsx @@ -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'; @@ -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;