File tree 1 file changed +5
-2
lines changed
src/pages/iou/request/step 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -173,14 +173,17 @@ function IOURequestStepConfirmation({
173
173
} , [ transactionID , defaultBillable ] ) ;
174
174
175
175
useEffect ( ( ) => {
176
+ // Exit early if the transaction is still loading
176
177
if ( isLoadingTransaction ) {
177
178
return ;
178
179
}
179
-
180
+
181
+ // Check if the transaction belongs to the current report
180
182
const isCurrentReportID = transaction ?. isFromGlobalCreate
181
183
? transaction ?. participants ?. at ( 0 ) ?. reportID === reportID || ( ! transaction ?. participants ?. at ( 0 ) ?. reportID && transaction ?. reportID === reportID )
182
184
: transaction ?. reportID === reportID ;
183
-
185
+
186
+ // Exit if the transaction already exists and is associated with the current report
184
187
if ( transaction ?. transactionID && ( ! transaction ?. isFromGlobalCreate || ! isEmptyObject ( transaction ?. participants ) ) && isCurrentReportID ) {
185
188
return ;
186
189
}
You can’t perform that action at this time.
0 commit comments