Fixes rendering issue if no opt out message is set (#235)

This commit is contained in:
Chris Anderson 2023-08-01 21:58:31 -05:00 committed by GitHub
parent aec10ec9fe
commit 8635b0293e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,7 +46,7 @@ const EmailForm = ({ form }: { form: UseFormReturn<TemplateUpdateParams, any> })
const TextTable = ({ data: { text } }: { data: TextTemplateData }) => {
const [project] = useContext(ProjectContext)
const segmentLength = 160
const optOutLength = project.text_opt_out_message.length
const optOutLength = project.text_opt_out_message?.length ?? 0
const length = (text?.length ?? 0) + optOutLength
const segments = Math.ceil(length / segmentLength)
return <InfoTable rows={{