Skip to content

Commit

Permalink
fix(button-variables): button link variables not showing to user in e…
Browse files Browse the repository at this point in the history
…mail message editor
  • Loading branch information
rockingrohit9639 committed Oct 6, 2023
1 parent 8e2dbea commit 25d0c2a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/web/src/hooks/useVariablesManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export const useVariablesManager = (index: number, contents: string[]) => {
({ templateToParse, fields }: { templateToParse?: ITemplates; fields: string[] }): string => {
return fields
.map((con) => con.split('.').reduce((a, b) => a && a[b], templateToParse ?? {}))
.map((con) => (Array.isArray(con) ? con.map((innerCon) => innerCon.content).join(' ') : con))
.map((con) =>
Array.isArray(con) ? con.map((innerCon) => `${innerCon.content} ${innerCon?.url}`).join(' ') : con
)
.join(' ');
},
[]
Expand Down

0 comments on commit 25d0c2a

Please sign in to comment.