From 00404fc8897fb54b25e6ada76fc4e89b6f05b4f5 Mon Sep 17 00:00:00 2001 From: yashim-deriv Date: Wed, 31 Jul 2024 14:01:04 +0800 Subject: [PATCH] fix: logout --- package-lock.json | 9 +++++---- package.json | 2 +- src/components/AppHeader/AppHeader.tsx | 12 ++++++++++-- .../AppHeader/MobileMenu/MobileMenuConfig.tsx | 4 +++- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 124268a6..b679a2ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "@babel/preset-env": "^7.24.5", "@chakra-ui/react": "^2.8.2", "@deriv-com/analytics": "^1.10.1", - "@deriv-com/api-hooks": "^1.4.5", + "@deriv-com/api-hooks": "^1.4.7", "@deriv-com/translations": "^1.2.4", "@deriv-com/ui": "^1.29.0", "@deriv-com/utils": "^0.0.28", @@ -3791,9 +3791,10 @@ } }, "node_modules/@deriv-com/api-hooks": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/@deriv-com/api-hooks/-/api-hooks-1.4.5.tgz", - "integrity": "sha512-FUaeoXHLCCXhLIcuQw3NdkeAYizINW/DhRa3VmAMtxZW4J8NlW0WszrxVwL5eAWLjy6qkhRw2KgMWKN4QP4u0g==", + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/@deriv-com/api-hooks/-/api-hooks-1.4.7.tgz", + "integrity": "sha512-A+mvQ0czQdTwXntpjQRKIOeKB9fPcZLqpPeWDKHuYKk0kuN/6Emeg84vWP2Xg1rwH592IT47g2y4HjVFmHl7pg==", + "license": "ISC", "dependencies": { "@deriv-com/utils": "^0.0.28", "@deriv/api-types": "^1.0.985", diff --git a/package.json b/package.json index 8ac8be1b..daa3737c 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@babel/preset-env": "^7.24.5", "@chakra-ui/react": "^2.8.2", "@deriv-com/analytics": "^1.10.1", - "@deriv-com/api-hooks": "^1.4.5", + "@deriv-com/api-hooks": "^1.4.7", "@deriv-com/translations": "^1.2.4", "@deriv-com/ui": "^1.29.0", "@deriv-com/utils": "^0.0.28", diff --git a/src/components/AppHeader/AppHeader.tsx b/src/components/AppHeader/AppHeader.tsx index 405eec3f..75a61e88 100644 --- a/src/components/AppHeader/AppHeader.tsx +++ b/src/components/AppHeader/AppHeader.tsx @@ -1,5 +1,5 @@ import { getOauthUrl } from '@/constants'; -import { api } from '@/hooks'; +import { api, useRedirectToOauth } from '@/hooks'; import { getCurrentRoute } from '@/utils'; import { StandaloneCircleUserRegularIcon } from '@deriv/quill-icons'; import { useAuthData } from '@deriv-com/api-hooks'; @@ -19,6 +19,7 @@ import './AppHeader.scss'; const AppHeader = () => { const { isDesktop } = useDevice(); const isEndpointPage = getCurrentRoute() === 'endpoint'; + const { redirectToOauth } = useRedirectToOauth(); const { activeLoginid, logout } = useAuthData(); const { data: activeAccount } = api.account.useActiveAccount(); const { localize } = useTranslations(); @@ -46,7 +47,14 @@ const AppHeader = () => { )} -