From e0d6cdcc9a0496c9e0f9db2e81c7a1cd31ce7c0e Mon Sep 17 00:00:00 2001 From: heavyweight Date: Thu, 5 Dec 2024 15:14:03 +0100 Subject: [PATCH] Check if `getConversations` is available before call --- packages/help-center/src/components/utils.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/help-center/src/components/utils.tsx b/packages/help-center/src/components/utils.tsx index 9b1b74d606b72..b95113890b7d5 100644 --- a/packages/help-center/src/components/utils.tsx +++ b/packages/help-center/src/components/utils.tsx @@ -24,7 +24,8 @@ export const getLastMessage = ( { conversation }: { conversation: ZendeskConvers }; export const getZendeskConversations = () => { - const conversations = Smooch.getConversations(); + const conversations = + typeof Smooch.getConversations === 'function' ? Smooch.getConversations() : []; return conversations as unknown as ZendeskConversation[]; };