Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rostislav / 86373 / Bug fix for side note on cashier page going missing once we navigate to different tabs like Withdrawal, Payments agents #7416

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const CashierOnboarding = observer(({ setSideNotes }) => {
const {
has_set_currency,
onMountCashierOnboarding,
is_cashier_onboarding,
setIsCashierOnboarding,
setIsDeposit,
setDepositTarget,
Expand Down Expand Up @@ -88,7 +89,7 @@ const CashierOnboarding = observer(({ setSideNotes }) => {
setSideNotes([<CashierOnboardingSideNote key={0} is_crypto={is_crypto} />]);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [is_switching, accounts, is_landing_company_loaded]);
}, [is_switching, accounts, is_landing_company_loaded, is_cashier_onboarding]);
Copy link
Contributor Author

@rostislav-deriv rostislav-deriv Jan 23, 2023

Choose a reason for hiding this comment

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

Adding this to dependency array because it gets set after component mounts.

The useEffect for which the dependency array was changed sets the side notes for the "Deposit" tab, but it was doing this before the side_notes state was being cleared by its "owner" (vertical-tab-content-container). The state-owning component clears side_notes on every tab change (e.g. Deposit -> Withdrawal or Withdrawal -> Deposit)


const openRealAccount = target => {
openRealAccountSignup('choose');
Expand Down