Skip to content

Commit

Permalink
chore: fix redirection before clicking on Get started
Browse files Browse the repository at this point in the history
  • Loading branch information
suisin-deriv committed Jan 10, 2025
1 parent 79bf4ae commit 57bb892
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
import { useHistory } from 'react-router-dom';
import Cookies from 'js-cookie';
import { Button, Icon, MobileDialog, Modal, Text } from '@deriv/components';
Expand All @@ -9,13 +9,19 @@ import './wallets-upgrade-completed-modal.scss';

const WalletsUpgradeCompletedModal = observer(() => {
const history = useHistory();
const { ui } = useStore();
const { client, ui } = useStore();
const { is_mobile } = ui;
const { setPreventRedirectToHub } = client;
const [isOpen, setIsOpen] = useState(true);

useEffect(() => {
setPreventRedirectToHub(true);
}, []);

const handleClose = () => {
setIsOpen(false);
Cookies.remove('recent_wallets_migration');
setPreventRedirectToHub(false);
history.push(routes.traders_hub);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const RootComponent = observer(props => {
}}
notificationMessagesUi={notification_messages_ui}
onWalletsOnboardingTourGuideCloseHandler={onWalletsOnboardingTourGuideCloseHandler}
isHubRedirectionEnabled={isHubRedirectionEnabled && !!trading_hub}
isHubRedirectionEnabled={isHubRedirectionEnabled || !!trading_hub}
/>
) : (
<AppStore {...props} />
Expand Down

0 comments on commit 57bb892

Please sign in to comment.