Skip to content

Commit

Permalink
Add feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
RunarVestmann committed Oct 16, 2024
1 parent a68d353 commit 78bfac7
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,20 @@ export const WatsonChatPanel = (props: WatsonChatPanelProps) => {
const namespaceValue = namespace?.[namespaceKey] ?? {}
const { cssVariables, ...languagePack } = namespaceValue

const replaceDirectorateOfImmigrationWebChatWithAI = Boolean(
namespace?.replaceDirectorateOfImmigrationWebChatWithAI,
)

const propsCopy = { ...props }

if (
!replaceDirectorateOfImmigrationWebChatWithAI &&
props.integrationID === '9e320784-ad44-4da9-9eb3-f305057a196a'
) {
propsCopy.integrationID = '89a03e83-5c73-4642-b5ba-cd3771ceca54'
propsCopy.serviceInstanceID = 'bc3d8312-d862-4750-b8bf-529db282050a'
}

let scriptElement: HTMLScriptElement | null = null

const queryParam = new URLSearchParams(window.location.search).get('wa_lid')
Expand Down Expand Up @@ -321,7 +335,7 @@ export const WatsonChatPanel = (props: WatsonChatPanelProps) => {
serviceDesk: {
skipConnectAgentCard: true,
},
...props,
...propsCopy,
onLoad: (instance) => {
watsonInstance.current = instance
if (Object.keys(cssVariables).length > 0) {
Expand Down

0 comments on commit 78bfac7

Please sign in to comment.