fix(editor): 🐛 Publish button sync
This commit is contained in:
@@ -20,7 +20,7 @@ export const parseTypebotToPublicTypebot = (
|
|||||||
variables: typebot.variables,
|
variables: typebot.variables,
|
||||||
})
|
})
|
||||||
|
|
||||||
const parseBlocksToPublicBlocks = (blocks: Block[]): PublicBlock[] =>
|
export const parseBlocksToPublicBlocks = (blocks: Block[]): PublicBlock[] =>
|
||||||
blocks.map((b) => ({
|
blocks.map((b) => ({
|
||||||
...b,
|
...b,
|
||||||
steps: b.steps.map(
|
steps: b.steps.map(
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ import {
|
|||||||
import { deepEqual } from 'fast-equals'
|
import { deepEqual } from 'fast-equals'
|
||||||
import { stringify } from 'qs'
|
import { stringify } from 'qs'
|
||||||
import { isChoiceInput, isConditionStep, sendRequest } from 'utils'
|
import { isChoiceInput, isConditionStep, sendRequest } from 'utils'
|
||||||
|
import { parseBlocksToPublicBlocks } from './publicTypebot'
|
||||||
|
|
||||||
export const useTypebots = ({
|
export const useTypebots = ({
|
||||||
folderId,
|
folderId,
|
||||||
@@ -223,9 +224,7 @@ export const checkIfPublished = (
|
|||||||
typebot: Typebot,
|
typebot: Typebot,
|
||||||
publicTypebot: PublicTypebot
|
publicTypebot: PublicTypebot
|
||||||
) =>
|
) =>
|
||||||
deepEqual(typebot.blocks, publicTypebot.blocks) &&
|
deepEqual(parseBlocksToPublicBlocks(typebot.blocks), publicTypebot.blocks) &&
|
||||||
typebot.name === publicTypebot.name &&
|
|
||||||
typebot.publicId === publicTypebot.publicId &&
|
|
||||||
deepEqual(typebot.settings, publicTypebot.settings) &&
|
deepEqual(typebot.settings, publicTypebot.settings) &&
|
||||||
deepEqual(typebot.theme, publicTypebot.theme)
|
deepEqual(typebot.theme, publicTypebot.theme)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user