File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
packages/bridge-status-controller/src Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -373,13 +373,17 @@ export class BridgeStatusController extends StaticIntervalPollingController<Brid
373
373
approvalTxId,
374
374
isStxEnabled,
375
375
} = startPollingForBridgeTxStatusArgs ;
376
- const accountAddress = this . #getMultichainSelectedAccountAddress( ) ;
377
- const txIdToUse = bridgeTxMeta . id ?? bridgeTxMeta . batchId ;
378
- if ( ! txIdToUse ) {
376
+
377
+ // Tis identifies the history item in state
378
+ // If it's a batched tx, we use the batchId until the tx is confirmed and
379
+ // the tx id is available
380
+ const txHistoryKey = bridgeTxMeta . id ?? bridgeTxMeta . batchId ;
381
+ if ( ! txHistoryKey ) {
379
382
throw new Error (
380
383
'Failed to add tx to history: No batch or tx id to use as key' ,
381
384
) ;
382
385
}
386
+ const accountAddress = this . #getMultichainSelectedAccountAddress( ) ;
383
387
// Write all non-status fields to state so we can reference the quote in Activity list without the Bridge API
384
388
// We know it's in progress but not the exact status yet
385
389
const txHistoryItem = {
@@ -414,7 +418,7 @@ export class BridgeStatusController extends StaticIntervalPollingController<Brid
414
418
} ;
415
419
this . update ( ( state ) => {
416
420
// Use the txMeta.id or batchId as the key so we can reference the txMeta in TransactionController
417
- state . txHistory [ txIdToUse ] = txHistoryItem ;
421
+ state . txHistory [ txHistoryKey ] = txHistoryItem ;
418
422
} ) ;
419
423
} ;
420
424
You can’t perform that action at this time.
0 commit comments