2
0

(setVariable) Add "Environment name" value in Set variable block (#850)

Closes #848
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
### Summary by CodeRabbit

- New Feature: Added "Environment name" as a new value type in the
SetVariable function, allowing users to distinguish between 'web' and
'whatsapp' environments.
- Refactor: Simplified session state handling in `resumeWhatsAppFlow.ts`
for improved code clarity.
- Refactor: Updated `startWhatsAppSession.ts` to include an initial
session state with WhatsApp contact and expiry timeout, enhancing
session management.
- Bug Fix: Improved null handling in `executeSetVariable.ts` for
'Contact name' and 'Phone number', preventing potential issues with
falsy values.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Baptiste Arnaud
2023-09-26 09:50:20 +02:00
committed by GitHub
parent 7b3cbdb8e8
commit 1ca742fc0b
9 changed files with 69 additions and 48 deletions

View File

@ -62,6 +62,7 @@ const Expression = ({
case 'Tomorrow':
case 'User ID':
case 'Moment of the day':
case 'Environment name':
case 'Yesterday': {
return (
<Text as="span">

View File

@ -158,6 +158,17 @@ const SetVariableValue = ({
</Alert>
)
}
case 'Environment name': {
return (
<Alert fontSize="sm">
<AlertIcon />
<Text>
Will return either <Tag size="sm">web</Tag> or{' '}
<Tag size="sm">whatsapp</Tag>.
</Text>
</Alert>
)
}
case 'Contact name':
case 'Phone number':
case 'Random ID':