@ -13,6 +13,7 @@ import { useState } from 'react'
|
||||
import { StandardSettings } from '../../../settings/StandardSettings'
|
||||
import { isCloudProdInstance } from '@/helpers/isCloudProdInstance'
|
||||
import { env } from '@typebot.io/env'
|
||||
import packageJson from '../../../../../../../../../../packages/embeds/js/package.json'
|
||||
|
||||
type Props = {
|
||||
publicId: string
|
||||
@ -76,7 +77,9 @@ const parseWordpressShortcode = ({
|
||||
publicId: string
|
||||
}) => {
|
||||
return `[typebot typebot="${publicId}"${
|
||||
isCloudProdInstance() ? '' : ` host="${env.NEXT_PUBLIC_VIEWER_URL[0]}"`
|
||||
isCloudProdInstance()
|
||||
? ''
|
||||
: ` host="${env.NEXT_PUBLIC_VIEWER_URL[0]}" lib_version="${packageJson.version}"`
|
||||
}${width ? ` width="${width}"` : ''}${height ? ` height="${height}"` : ''}]
|
||||
`
|
||||
}
|
||||
|
@ -87,7 +87,6 @@ const getCurrentUserMode = (
|
||||
workspace: { members: { userId: string }[] }
|
||||
}
|
||||
) => {
|
||||
if (user?.email === env.ADMIN_EMAIL) return 'read'
|
||||
const collaborator = typebot.collaborators.find((c) => c.userId === user?.id)
|
||||
const isMemberOfWorkspace = typebot.workspace.members.some(
|
||||
(m) => m.userId === user?.id
|
||||
@ -100,5 +99,6 @@ const getCurrentUserMode = (
|
||||
return 'write'
|
||||
|
||||
if (collaborator) return 'read'
|
||||
if (user?.email === env.ADMIN_EMAIL) return 'read'
|
||||
return 'guest'
|
||||
}
|
||||
|
Reference in New Issue
Block a user