Skip to content

Commit

Permalink
🐛 (chatwoot) Fix setUser with variables
Browse files Browse the repository at this point in the history
Closes #300
  • Loading branch information
baptisteArno committed Feb 7, 2023
1 parent f07bf25 commit f936d4f
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parseVariables, parseCorrectValueType } from '@/features/variables'
import { parseVariables } from '@/features/variables'
import { IntegrationState } from '@/types'
import { sendEventToParent } from '@/utils/chat'
import { isEmbedded } from '@/utils/helpers'
Expand Down Expand Up @@ -68,13 +68,10 @@ export const executeChatwootBlock = (
})
} else {
const func = Function(
...variables.map((v) => v.id),
parseVariables(variables, { fieldToParse: 'id' })(
parseChatwootOpenCode(block.options)
)
parseVariables(variables)(parseChatwootOpenCode(block.options))
)
try {
func(...variables.map((v) => parseCorrectValueType(v.value)))
func()
} catch (err) {
console.error(err)
}
Expand Down

0 comments on commit f936d4f

Please sign in to comment.