Skip to content

Commit

Permalink
feat(web): Boost.ai - Set language depending on activeLocale (#17461)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
RunarVestmann and kodiakhq[bot] committed Jan 9, 2025
1 parent a41293d commit 485c7af
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apps/web/components/ChatPanel/BoostChatPanel/BoostChatPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ export const BoostChatPanel: React.FC<
'wa_lid',
)
if (queryParam && ['t10', 't11'].includes(queryParam)) {
window.boost.chatPanel.setStartLanguage(
activeLocale === 'en' ? 'en-US' : 'is-IS',
)
window.boost.chatPanel.show()
}
})
Expand All @@ -81,7 +84,7 @@ export const BoostChatPanel: React.FC<
el.id = 'boost-script'
document.body.appendChild(el)
}
}, [endpoint])
}, [activeLocale, endpoint])

const { data } = useQuery<Query, QueryGetNamespaceArgs>(GET_NAMESPACE_QUERY, {
variables: {
Expand All @@ -102,7 +105,12 @@ export const BoostChatPanel: React.FC<
return (
<ChatBubble
text={n('chatBubbleText', 'Hæ, get ég aðstoðað?')}
onClick={() => window.boost.chatPanel.show()}
onClick={() => {
window.boost.chatPanel.setStartLanguage(
activeLocale === 'en' ? 'en-US' : 'is-IS',
)
window.boost.chatPanel.show()
}}
isVisible={showButton}
pushUp={pushUp}
/>
Expand Down

0 comments on commit 485c7af

Please sign in to comment.