File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
frontends/web/src/components/transactions Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,12 @@ export const TransactionDetails = ({
51
51
if ( ! internalID ) {
52
52
return ;
53
53
}
54
+ const currentID = internalID ;
54
55
getTransaction ( accountCode , internalID )
55
56
. then ( transaction => {
57
+ if ( internalID !== currentID ) {
58
+ return ; // Ignore if internalID has changed since the request was made.
59
+ }
56
60
if ( ! transaction ) {
57
61
console . error ( `Unable to retrieve transaction ${ internalID } ` ) ;
58
62
return ;
@@ -68,11 +72,8 @@ export const TransactionDetails = ({
68
72
} , [ fetchTransaction ] ) ;
69
73
70
74
useEffect ( ( ) => {
71
- if ( ! internalID ) {
72
- return ;
73
- }
74
- return syncdone ( accountCode , fetchTransaction )
75
- } , [ accountCode , internalID , fetchTransaction ] ) ;
75
+ return syncdone ( accountCode , fetchTransaction ) ;
76
+ } , [ accountCode , fetchTransaction ] ) ;
76
77
77
78
if ( ! transactionInfo ) {
78
79
return null ;
You can’t perform that action at this time.
0 commit comments