|
1 | 1 | import { recordTracksEvent } from '@automattic/calypso-analytics'; |
2 | | -import { HelpCenterSelect } from '@automattic/data-stores'; |
| 2 | +import { HelpCenterSelect, isLoggedInHCUser } from '@automattic/data-stores'; |
3 | 3 | import { HELP_CENTER_STORE } from '@automattic/help-center/src/stores'; |
4 | 4 | import { useIsMutating } from '@tanstack/react-query'; |
5 | 5 | import { useSelect } from '@wordpress/data'; |
6 | 6 | import { useState, useEffect, useRef } from '@wordpress/element'; |
7 | 7 | import { useLocation } from 'react-router-dom'; |
8 | 8 | import { getMessageUniqueIdentifier } from '../components/message/utils/get-message-unique-identifier'; |
9 | 9 | import { getOdieTransferMessage } from '../constants'; |
10 | | -import { emptyChat, useOdieAssistantContext } from '../context'; |
| 10 | +import { emptyChat } from '../context'; |
11 | 11 | import { useGetZendeskConversation, useManageSupportInteraction, useOdieChat } from '../data'; |
12 | 12 | import { useCurrentSupportInteraction } from '../data/use-current-support-interaction'; |
13 | 13 | import { |
@@ -49,10 +49,8 @@ export const useGetCombinedChat = ( |
49 | 49 | const { data: currentSupportInteraction, isLoading: isLoadingCurrentSupportInteraction } = |
50 | 50 | useCurrentSupportInteraction(); |
51 | 51 |
|
52 | | - const { currentUser } = useOdieAssistantContext(); |
53 | | - |
54 | 52 | const location = useLocation(); |
55 | | - const isLoggedIn = !! currentUser?.ID; |
| 53 | + const isLoggedIn = isLoggedInHCUser(); |
56 | 54 | const params = new URLSearchParams( location.search ); |
57 | 55 | const loggedOutOdieChatId = params.get( 'chatId' ); |
58 | 56 | const loggedOutOdieSessionId = params.get( 'sessionId' ); |
|
0 commit comments