Skip to content

Commit c5ca457

Browse files
alshakeroescapemanuele
authored andcommitted
Fix support history
1 parent 75c967a commit c5ca457

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

packages/help-center/src/components/help-center-recent-conversations.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const HelpCenterRecentConversations: React.FC = () => {
4646

4747
const chatLink =
4848
recentConversation.metadata && 'sessionId' in recentConversation.metadata
49-
? `/odie?chatId=${ recentConversation.id }&sessionId=${ recentConversation.metadata?.sessionId }`
49+
? `/odie?chatId=${ recentConversation.id }&sessionId=${ recentConversation.metadata?.sessionId }&botSlug=${ recentConversation.metadata?.botSlug }`
5050
: `/odie?id=${ recentConversation.metadata?.supportInteractionId }`;
5151

5252
return (

packages/help-center/src/components/help-center-support-chat-message.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,14 @@ export const HelpCenterSupportChatMessage = ( {
129129
);
130130
}
131131

132+
const chatLink =
133+
conversation.metadata && 'sessionId' in conversation.metadata
134+
? `/odie?chatId=${ conversation.id }&sessionId=${ conversation.metadata?.sessionId }&botSlug=${ conversation.metadata?.botSlug }`
135+
: `/odie?id=${ conversation.metadata?.supportInteractionId }`;
136+
132137
return (
133138
<Link
134-
to={ `/odie?id=${ supportInteraction?.uuid }` }
139+
to={ chatLink }
135140
onClick={ () => {
136141
trackContactButtonClicked( sectionName || helpCenterContextSectionName );
137142
} }

packages/help-center/src/hooks/use-get-history-chats.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,14 @@ export const useGetHistoryChats = (): UseGetHistoryChatsResult => {
149149
useEffect( () => {
150150
if ( loggedOutChat.data ) {
151151
setRecentConversations( [
152-
convertOdieChatToOdieConversation( loggedOutChat.data, loggedOutSession?.sessionId || '' ),
152+
convertOdieChatToOdieConversation(
153+
loggedOutChat.data,
154+
loggedOutSession?.sessionId || '',
155+
loggedOutSession?.botSlug || ''
156+
),
153157
] );
154158
}
155-
}, [ loggedOutChat.data, loggedOutSession?.sessionId ] );
159+
}, [ loggedOutChat.data, loggedOutSession?.sessionId, loggedOutSession?.botSlug ] );
156160

157161
const { data: otherSupportInteractions, isLoading: isLoadingOtherSupportInteractions } =
158162
useGetSupportInteractions( 'zendesk' );
@@ -189,7 +193,8 @@ export const useGetHistoryChats = (): UseGetHistoryChatsResult => {
189193
? [
190194
convertOdieChatToOdieConversation(
191195
loggedOutChat.data,
192-
loggedOutSession?.sessionId || ''
196+
loggedOutSession?.sessionId || '',
197+
loggedOutSession?.botSlug || ''
193198
),
194199
]
195200
: [] ),

0 commit comments

Comments
 (0)