@@ -5,7 +5,7 @@ import { Location } from 'history';
55import { default as wpcomRequestPromise , canAccessWpcomApis } from 'wpcom-proxy-request' ;
66import { GeneratorReturnType } from '../mapped-types' ;
77import { SiteDetails } from '../site' ;
8- import { isE2ETest } from '../utils' ;
8+ import { isE2ETest , isLoggedInHCUser } from '../utils' ;
99import { STORE_KEY } from './constants' ;
1010import type { HelpCenterOptions , HelpCenterSelect , HelpCenterShowOptions } from './types' ;
1111import type { APIFetchOptions } from '../shared-types' ;
@@ -16,6 +16,10 @@ import type { APIFetchOptions } from '../shared-types';
1616 * @param isMinimized - Whether the help center is minimized.
1717 */
1818export const saveOpenState = ( isShown : boolean | undefined , isMinimized : boolean | undefined ) => {
19+ if ( ! isLoggedInHCUser ( ) ) {
20+ return null ;
21+ }
22+
1923 const saveState : Record < string , boolean | null > = { } ;
2024
2125 if ( typeof isShown === 'boolean' ) {
@@ -90,6 +94,14 @@ export const setIsMinimized = function* ( minimized: boolean ) {
9094 } as const ;
9195} ;
9296
97+ export const setLoggedOutOdieChat = (
98+ session : { odieId : number ; sessionId : string ; botSlug : string } | undefined
99+ ) =>
100+ ( {
101+ type : 'HELP_CENTER_SET_LOGGED_OUT_ODIE_CHAT' ,
102+ session,
103+ } ) as const ;
104+
93105export const setIsChatLoaded = ( isChatLoaded : boolean ) =>
94106 ( {
95107 type : 'HELP_CENTER_SET_IS_CHAT_LOADED' ,
@@ -286,6 +298,7 @@ export type HelpCenterAction =
286298 | typeof setSubject
287299 | typeof resetStore
288300 | typeof setMessage
301+ | typeof setLoggedOutOdieChat
289302 | typeof setContextTerm
290303 | typeof setUserDeclaredSite
291304 | typeof setUserDeclaredSiteUrl
@@ -294,6 +307,7 @@ export type HelpCenterAction =
294307 | typeof setIsChatLoaded
295308 | typeof setAreSoundNotificationsEnabled
296309 | typeof setZendeskClientId
310+ | typeof setLoggedOutOdieChat
297311 | typeof setSupportTypingStatus
298312 | typeof setZendeskConnectionStatus
299313 | typeof setNavigateToRoute
0 commit comments