Skip to content

Commit

Permalink
[WALL] / george / WALL-4812 / Banxa is not working for any crypto cur…
Browse files Browse the repository at this point in the history
…rencies (#16673)

* fix(cashier): 🚑 fix onramp provider redirection

* test(cashier): 🧪 fix test
  • Loading branch information
heorhi-deriv committed Aug 29, 2024
1 parent 983975a commit a682212
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/cashier/src/pages/on-ramp/__tests__/on-ramp.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ describe('<OnRamp />', () => {
setIsOnRampModalOpen: jest.fn(),
should_show_dialog: false,
onramp_popup_modal_title: 'Title of the onramp popup modal',
onMountOnramp: jest.fn(),
onUnmountOnramp: jest.fn(),
},
general_store: {
is_loading: false,
Expand Down
10 changes: 10 additions & 0 deletions packages/cashier/src/pages/on-ramp/on-ramp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ const OnRamp = observer(({ menu_options }: TOnRampProps) => {
const {
filtered_onramp_providers,
is_onramp_modal_open,
onMountOnramp,
onUnmountOnramp,
onramp_popup_modal_title,
resetPopup,
setIsOnRampModalOpen,
Expand All @@ -81,6 +83,14 @@ const OnRamp = observer(({ menu_options }: TOnRampProps) => {
}
}, [menu_options, routeTo, selected_cashier_path]);

React.useEffect(() => {
onMountOnramp();

return () => {
onUnmountOnramp();
};
}, [onMountOnramp, onUnmountOnramp]);

const getActivePaths = () =>
(menu_options ?? []).map(menu_option => ({
text: menu_option.label,
Expand Down

0 comments on commit a682212

Please sign in to comment.