-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚡ Improve new bot engine client side actions
We make sure to save client side actions in an array that will be executed sequentially
- Loading branch information
1 parent
0fc82cf
commit 9aab6dd
Showing
15 changed files
with
133 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { executeChatwoot } from '@/features/blocks/integrations/chatwoot' | ||
import { executeGoogleAnalyticsBlock } from '@/features/blocks/integrations/googleAnalytics/utils/executeGoogleAnalytics' | ||
import { executeCode } from '@/features/blocks/logic/code' | ||
import { executeRedirect } from '@/features/blocks/logic/redirect' | ||
import type { ChatReply } from 'models' | ||
|
||
export const executeClientSideAction = async ( | ||
clientSideAction: NonNullable<ChatReply['clientSideActions']>[0] | ||
) => { | ||
if ('chatwoot' in clientSideAction) { | ||
executeChatwoot(clientSideAction.chatwoot) | ||
} | ||
if ('googleAnalytics' in clientSideAction) { | ||
executeGoogleAnalyticsBlock(clientSideAction.googleAnalytics) | ||
} | ||
if ('codeToExecute' in clientSideAction) { | ||
await executeCode(clientSideAction.codeToExecute) | ||
} | ||
if ('redirect' in clientSideAction) { | ||
executeRedirect(clientSideAction.redirect) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.