Skip to content

Commit 5d307b9

Browse files
committed
add comment
1 parent af7455a commit 5d307b9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/pages/iou/request/step/IOURequestStepConfirmation.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,17 @@ function IOURequestStepConfirmation({
173173
}, [transactionID, defaultBillable]);
174174

175175
useEffect(() => {
176+
// Exit early if the transaction is still loading
176177
if (isLoadingTransaction) {
177178
return;
178179
}
179-
180+
181+
// Check if the transaction belongs to the current report
180182
const isCurrentReportID = transaction?.isFromGlobalCreate
181183
? transaction?.participants?.at(0)?.reportID === reportID || (!transaction?.participants?.at(0)?.reportID && transaction?.reportID === reportID)
182184
: transaction?.reportID === reportID;
183-
185+
186+
// Exit if the transaction already exists and is associated with the current report
184187
if (transaction?.transactionID && (!transaction?.isFromGlobalCreate || !isEmptyObject(transaction?.participants)) && isCurrentReportID) {
185188
return;
186189
}

0 commit comments

Comments
 (0)