🐛 Fix board menu placement when suspected typebot banner is displayed
This commit is contained in:
@ -28,15 +28,15 @@ export const EditorPage = () => {
|
|||||||
)
|
)
|
||||||
const bgColor = useColorModeValue('#f4f5f8', 'gray.850')
|
const bgColor = useColorModeValue('#f4f5f8', 'gray.850')
|
||||||
|
|
||||||
|
const isSuspicious = typebot?.riskLevel === 100 && !workspace?.isVerified
|
||||||
|
|
||||||
if (is404) return <TypebotNotFoundPage />
|
if (is404) return <TypebotNotFoundPage />
|
||||||
return (
|
return (
|
||||||
<EditorProvider>
|
<EditorProvider>
|
||||||
<Seo title={typebot?.name ? `${typebot.name} | Editor` : 'Editor'} />
|
<Seo title={typebot?.name ? `${typebot.name} | Editor` : 'Editor'} />
|
||||||
<Flex overflow="clip" h="100vh" flexDir="column" id="editor-container">
|
<Flex overflow="clip" h="100vh" flexDir="column" id="editor-container">
|
||||||
<GettingStartedModal />
|
<GettingStartedModal />
|
||||||
{typebot?.riskLevel === 100 && !workspace?.isVerified && (
|
{isSuspicious && <SuspectedTypebotBanner typebotId={typebot.id} />}
|
||||||
<SuspectedTypebotBanner typebotId={typebot.id} />
|
|
||||||
)}
|
|
||||||
<TypebotHeader />
|
<TypebotHeader />
|
||||||
<Flex
|
<Flex
|
||||||
flex="1"
|
flex="1"
|
||||||
@ -57,7 +57,11 @@ export const EditorPage = () => {
|
|||||||
>
|
>
|
||||||
<EventsCoordinatesProvider events={typebot.events}>
|
<EventsCoordinatesProvider events={typebot.events}>
|
||||||
<Graph flex="1" typebot={typebot} key={typebot.id} />
|
<Graph flex="1" typebot={typebot} key={typebot.id} />
|
||||||
<BoardMenuButton pos="absolute" right="40px" top="20px" />
|
<BoardMenuButton
|
||||||
|
pos="absolute"
|
||||||
|
right="40px"
|
||||||
|
top={`calc(20px + ${isSuspicious ? '70px' : '0'})`}
|
||||||
|
/>
|
||||||
<RightPanel />
|
<RightPanel />
|
||||||
</EventsCoordinatesProvider>
|
</EventsCoordinatesProvider>
|
||||||
</GraphProvider>
|
</GraphProvider>
|
||||||
|
@ -77,6 +77,11 @@ export const PublishButton = ({
|
|||||||
title: t('publish.error.label'),
|
title: t('publish.error.label'),
|
||||||
description: error.message,
|
description: error.message,
|
||||||
})
|
})
|
||||||
|
if (error.data?.httpStatus === 403) {
|
||||||
|
setTimeout(() => {
|
||||||
|
window.location.reload()
|
||||||
|
}, 3000)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
refetchPublishedTypebot({
|
refetchPublishedTypebot({
|
||||||
|
@ -98,7 +98,11 @@ export const publishTypebot = authenticatedProcedure
|
|||||||
'Radar detected a potential malicious typebot. This bot is being manually reviewed by Fraud Prevention team.',
|
'Radar detected a potential malicious typebot. This bot is being manually reviewed by Fraud Prevention team.',
|
||||||
})
|
})
|
||||||
|
|
||||||
const riskLevel = typebotWasVerified ? 0 : computeRiskLevel(existingTypebot)
|
const riskLevel = typebotWasVerified
|
||||||
|
? 0
|
||||||
|
: computeRiskLevel(existingTypebot, {
|
||||||
|
debug: env.NODE_ENV === 'development',
|
||||||
|
})
|
||||||
|
|
||||||
if (riskLevel > 0 && riskLevel !== existingTypebot.riskLevel) {
|
if (riskLevel > 0 && riskLevel !== existingTypebot.riskLevel) {
|
||||||
if (env.MESSAGE_WEBHOOK_URL && riskLevel !== 100 && riskLevel > 60)
|
if (env.MESSAGE_WEBHOOK_URL && riskLevel !== 100 && riskLevel > 60)
|
||||||
|
Reference in New Issue
Block a user