Skip to content

Commit fb70480

Browse files
committed
cleanup
1 parent cb5585f commit fb70480

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/SmartTransactionsController.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,9 @@ export default class SmartTransactionsController extends PollingControllerV1<
292292
smartTransaction: SmartTransaction,
293293
chainId: string,
294294
): void {
295-
const currentChainId = chainId || this.config.chainId;
296295
const { smartTransactionsState } = this.state;
297296
const { smartTransactions } = smartTransactionsState;
298-
const currentSmartTransactions = smartTransactions[currentChainId];
297+
const currentSmartTransactions = smartTransactions[chainId];
299298
const currentIndex = currentSmartTransactions?.findIndex(
300299
(stx) => stx.uuid === smartTransaction.uuid,
301300
);
@@ -331,7 +330,7 @@ export default class SmartTransactionsController extends PollingControllerV1<
331330
...smartTransactionsState,
332331
smartTransactions: {
333332
...smartTransactionsState.smartTransactions,
334-
[currentChainId]: nextSmartTransactions,
333+
[chainId]: nextSmartTransactions,
335334
},
336335
},
337336
});
@@ -349,21 +348,21 @@ export default class SmartTransactionsController extends PollingControllerV1<
349348
...currentSmartTransaction,
350349
...smartTransaction,
351350
};
352-
this.confirmSmartTransaction(nextSmartTransaction, currentChainId);
351+
this.confirmSmartTransaction(nextSmartTransaction, chainId);
353352
}
354353

355354
this.update({
356355
smartTransactionsState: {
357356
...smartTransactionsState,
358357
smartTransactions: {
359358
...smartTransactionsState.smartTransactions,
360-
[currentChainId]: smartTransactionsState.smartTransactions[
361-
currentChainId
362-
].map((item, index) => {
363-
return index === currentIndex
364-
? { ...item, ...smartTransaction }
365-
: item;
366-
}),
359+
[chainId]: smartTransactionsState.smartTransactions[chainId].map(
360+
(item, index) => {
361+
return index === currentIndex
362+
? { ...item, ...smartTransaction }
363+
: item;
364+
},
365+
),
367366
},
368367
},
369368
});

0 commit comments

Comments
 (0)