Skip to content

Commit

Permalink
Check if getConversations is available before call
Browse files Browse the repository at this point in the history
  • Loading branch information
heavyweight committed Dec 5, 2024
1 parent 0363e10 commit e0d6cdc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/help-center/src/components/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
};

Expand Down

0 comments on commit e0d6cdc

Please sign in to comment.