Skip to content

Commit 0a8332b

Browse files
committed
fix: improve transaction operation direction detection with identical operations check
1 parent 36bb84a commit 0a8332b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/app/src/systems/Transaction/components/TxOperations/TxOperationsDrawer.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,26 @@ export function TxOperationsDrawer({ operations }: TxOperationsDrawerProps) {
2929
current: SimplifiedOperation,
3030
next: SimplifiedOperation
3131
) {
32+
console.log('previous', previous);
33+
console.log('current', current);
34+
console.log('next', next);
3235
// if next operation is the reverse of the current operation, return 'atob'
3336
// if previous operation is the reverse of the current operation, return 'btoa'
3437
// otherwise return null
3538
if (
3639
next &&
3740
next.from.address === current.to.address &&
38-
next.to.address === current.from.address
41+
next.to.address === current.from.address &&
42+
(!next.metadata?.identicalOps || next.metadata.identicalOps.size === 0)
3943
) {
4044
return 'atob';
4145
}
4246
if (
4347
previous &&
4448
previous.from.address === current.to.address &&
45-
previous.to.address === current.from.address
49+
previous.to.address === current.from.address &&
50+
(!previous.metadata?.identicalOps ||
51+
previous.metadata.identicalOps.size === 0)
4652
) {
4753
return 'btoa';
4854
}

0 commit comments

Comments
 (0)