🐛 (share) Fix duplicate folderId issue

This commit is contained in:
Baptiste Arnaud
2023-11-28 16:32:56 +01:00
parent cf8df68186
commit 8ce4e4808d
5 changed files with 12 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
import { Stack, Input, InputGroup, InputRightElement } from '@chakra-ui/react'
import React, { useMemo } from 'react'
import React from 'react'
import { SwitchWithRelatedSettings } from '@/components/SwitchWithRelatedSettings'
import { CopyButton } from '@/components/CopyButton'
import { CollaborationList } from '@/features/collaboration/components/CollaborationList'
@@ -8,7 +8,7 @@ import { useTypebot } from '@/features/editor/providers/TypebotProvider'
export const SharePopoverContent = () => {
const { typebot, updateTypebot } = useTypebot()
const currentUrl = useMemo(() => window.location.href.split('?')[0], [])
const currentUrl = `${window.location.origin}/typebots/${typebot?.id}/edit`
const updateIsPublicShareEnabled = async (isEnabled: boolean) => {
await updateTypebot({

View File

@@ -28,6 +28,7 @@ const omittedProps = {
resultsTablePreferencesSchema: true,
selectedThemeTemplateId: true,
publicId: true,
folderId: true,
} as const
const importingTypebotSchema = z.preprocess(
@@ -62,6 +63,7 @@ const migrateImportingTypebot = (
isArchived: false,
whatsAppCredentialsId: null,
publicId: null,
folderId: null,
} satisfies Typebot
return migrateTypebot(fullTypebot)
}