Skip to content

Commit

Permalink
fix: 🐛 widget should not use next deps
Browse files Browse the repository at this point in the history
  • Loading branch information
gmpetrov committed Apr 5, 2024
1 parent 8a2b93b commit b7a2230
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions apps/dashboard/components/BlablaFormEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ function Form({ formId }: Props) {
webhook: draftConfig?.webhook,
schema: (query.data?.draftConfig as any)?.schema,
}}
isInEditor
/>
</Stack>
</Stack>
Expand Down
3 changes: 3 additions & 0 deletions apps/dashboard/components/BlablaFormViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type Props = {
messageId?: string;
config?: FormConfigSchema;
type: 'conversational' | 'traditional';
isInEditor?: boolean;
};

const FormButton = styled(Button)(({ theme }) => ({
Expand Down Expand Up @@ -72,6 +73,7 @@ function BlablaFormViewer({
messageId,
config,
type,
isInEditor,
}: Props) {
const triggerConfetti = useConfetti();

Expand Down Expand Up @@ -165,6 +167,7 @@ function BlablaFormViewer({
conversationId={conversationId}
messageId={messageId}
config={config}
isInEditor={isInEditor}
/>
</Stack>
)}
Expand Down
9 changes: 3 additions & 6 deletions apps/dashboard/components/TraditionalForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
} from '@mui/joy';
import axios from 'axios';
import { AnimatePresence, motion } from 'framer-motion';
import { useRouter } from 'next/router';
import { memo, useEffect, useMemo, useState } from 'react';
import { useForm } from 'react-hook-form';
import useSWR from 'swr';
Expand Down Expand Up @@ -274,18 +273,16 @@ function TraditionalForm({
conversationId,
messageId,
submissionId,
isInEditor,
...otherProps
}: {
formId: string;
conversationId?: string;
messageId?: string;
submissionId?: string;
config?: any;
isInEditor?: boolean;
}) {
const {
query: { tab },
} = useRouter();

const getFormQuery = useSWR<Prisma.PromiseReturnType<typeof getForm>>(
formId ? `/api/forms/${formId}` : null,
fetcher
Expand All @@ -311,7 +308,7 @@ function TraditionalForm({

const config = useMemo(() => {
return (
tab === 'editor'
!!isInEditor
? otherProps.config || getFormQuery?.data?.draftConfig
: getFormQuery?.data?.publishedConfig
) as FormConfigSchema;
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@chaindesk/embeds",
"version": "1.0.159",
"version": "1.0.161",
"description": "Chaindesk Embeds",
"main": "dist/chatbox/index.js",
"scripts": {},
Expand Down

0 comments on commit b7a2230

Please sign in to comment.