From 57bb892f6cece12b7e333f2b42a9fa8bdd877d27 Mon Sep 17 00:00:00 2001 From: Tay Sui Sin Date: Thu, 9 Jan 2025 11:28:26 +0800 Subject: [PATCH] chore: fix redirection before clicking on Get started --- .../wallets-upgrade-completed-modal.tsx | 10 ++++++++-- .../App/Containers/RootComponent/root-component.jsx | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/core/src/App/Containers/Modals/wallets-upgrade-completed-modal/wallets-upgrade-completed-modal.tsx b/packages/core/src/App/Containers/Modals/wallets-upgrade-completed-modal/wallets-upgrade-completed-modal.tsx index 691967745825..e31304638034 100644 --- a/packages/core/src/App/Containers/Modals/wallets-upgrade-completed-modal/wallets-upgrade-completed-modal.tsx +++ b/packages/core/src/App/Containers/Modals/wallets-upgrade-completed-modal/wallets-upgrade-completed-modal.tsx @@ -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'; @@ -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); }; diff --git a/packages/core/src/App/Containers/RootComponent/root-component.jsx b/packages/core/src/App/Containers/RootComponent/root-component.jsx index 962a841a3468..8a1cfda5e7df 100644 --- a/packages/core/src/App/Containers/RootComponent/root-component.jsx +++ b/packages/core/src/App/Containers/RootComponent/root-component.jsx @@ -53,7 +53,7 @@ const RootComponent = observer(props => { }} notificationMessagesUi={notification_messages_ui} onWalletsOnboardingTourGuideCloseHandler={onWalletsOnboardingTourGuideCloseHandler} - isHubRedirectionEnabled={isHubRedirectionEnabled && !!trading_hub} + isHubRedirectionEnabled={isHubRedirectionEnabled || !!trading_hub} /> ) : (