2
0

fix(engine): 📦️ Compatible with iPhone 6

This commit is contained in:
Baptiste Arnaud
2022-05-30 11:02:43 +02:00
parent d6b5568e03
commit 92cd56e5d0
6 changed files with 20 additions and 11 deletions

View File

@ -2,6 +2,7 @@ import { IncomingMessage } from 'http'
import { NotFoundPage } from 'layouts/NotFoundPage'
import { PublicTypebot } from 'models'
import { GetServerSideProps, GetServerSidePropsContext } from 'next'
import sanitizeHtml from 'sanitize-html'
import { isDefined, isNotDefined, omit } from 'utils'
import { TypebotPage, TypebotPageProps } from '../layouts/TypebotPage'
import prisma from '../libs/prisma'
@ -36,11 +37,16 @@ export const getServerSideProps: GetServerSideProps = async (
? `Couldn't find publicId: ${context.query.publicId?.toString()}`
: `Couldn't find customDomain: ${customDomain}`
)
const headCode = typebot?.settings.metadata.customHeadCode
return {
props: {
typebot,
isIE,
url: `https://${forwardedHost ?? host}${pathname}`,
customHeadCode:
isDefined(headCode) && headCode !== ''
? sanitizeHtml(headCode, { allowedTags: ['script', 'meta'] })
: null,
},
}
} catch (err) {