Skip to content

Commit e1c5175

Browse files
committed
data is not loaded again
1 parent 8ffb15b commit e1c5175

2 files changed

Lines changed: 1 addition & 11 deletions

File tree

src/libs/actions/ReimbursementAccount/resetNonUSDBankAccount.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@ function resetNonUSDBankAccount(policyID: string | undefined, achAccount: OnyxEn
1818
key: ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM_DRAFT,
1919
value: null,
2020
},
21-
{
22-
onyxMethod: Onyx.METHOD.MERGE,
23-
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
24-
value: {
25-
shouldShowResetModal: false,
26-
isLoading: true,
27-
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
28-
achData: null,
29-
},
30-
},
3121
{
3222
onyxMethod: Onyx.METHOD.MERGE,
3323
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,

src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function ReimbursementAccountPage({route, policy, isLoadingPolicy, navigation}:
194194
}
195195
fetchData();
196196
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
197-
}, []); // The empty dependency array ensures this runs only once after the component mounts.
197+
}, [isPreviousPolicy]); // Only re-run this effect when isPreviousPolicy changes, which happens once when the component first loads
198198

199199
useEffect(() => {
200200
if (!isPreviousPolicy) {

0 commit comments

Comments
 (0)