Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/SettlementButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function SettlementButton({
return;
}
pressLockedBankAccount(policy?.achAccount?.bankAccountID, translate, conciergeReportID);
navigateToConciergeChat(conciergeReportID, introSelected, currentUserAccountID, isSelfTourViewed);
navigateToConciergeChat(conciergeReportID, introSelected, currentUserAccountID, isSelfTourViewed, betas);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add betas to memoized lock-action dependencies

The checkForNecessaryAction callback now uses betas when calling navigateToConciergeChat, but betas is not included in that callback’s dependency array. If BETAS loads or changes after initial render (while other dependencies stay stable), this handler can retain a stale value and navigate with outdated beta data when the locked bank-account path runs, which can produce incorrect concierge report creation behavior when conciergeReportID is missing.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty sure betas are loaded when the app loads, so they essentially won't ever change live - so i don't think this is a real concern

});
return true;
}
Expand Down Expand Up @@ -248,6 +248,7 @@ function SettlementButton({
introSelected,
currentUserAccountID,
isSelfTourViewed,
betas,
]);

const shortFormPayElsewhereButton = {
Expand Down
3 changes: 2 additions & 1 deletion src/pages/settings/Wallet/WalletPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ function WalletPage() {
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [isSelfTourViewed] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector});
const [betas] = useOnyx(ONYXKEYS.BETAS);
const isUserValidated = userAccount?.validated ?? false;
const {isAccountLocked} = useLockedAccountState();
const {showLockedAccountModal} = useLockedAccountActions();
Expand Down Expand Up @@ -143,7 +144,7 @@ function WalletPage() {

if (accountData?.state === CONST.BANK_ACCOUNT.STATE.LOCKED && accountData?.bankAccountID) {
pressLockedBankAccount(accountData?.bankAccountID, translate, conciergeReportID ?? undefined);
navigateToConciergeChat(conciergeReportID ?? undefined, introSelected, currentUserAccountID, isSelfTourViewed);
navigateToConciergeChat(conciergeReportID ?? undefined, introSelected, currentUserAccountID, isSelfTourViewed, betas);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ function WorkspaceWorkflowsPage({policy, route}: WorkspaceWorkflowsPageProps) {
// User who is reimburser can initiate unlocking process
if (state === CONST.BANK_ACCOUNT.STATE.LOCKED && bankAccountID && isUserReimburser) {
pressLockedBankAccount(bankAccountID, translate, conciergeReportID ?? undefined);
navigateToConciergeChat(conciergeReportID ?? undefined, introSelected, currentUserAccountID, isSelfTourViewed);
navigateToConciergeChat(conciergeReportID ?? undefined, introSelected, currentUserAccountID, isSelfTourViewed, betas);
return;
}

Expand Down
Loading