diff --git a/apps/builder/src/features/workspace/WorkspaceProvider.tsx b/apps/builder/src/features/workspace/WorkspaceProvider.tsx
index 107d5aa01..a2da3006c 100644
--- a/apps/builder/src/features/workspace/WorkspaceProvider.tsx
+++ b/apps/builder/src/features/workspace/WorkspaceProvider.tsx
@@ -6,7 +6,7 @@ import {
useMemo,
useState,
} from 'react'
-import { byId } from '@typebot.io/lib'
+import { byId, isNotDefined } from '@typebot.io/lib'
import { WorkspaceRole } from '@typebot.io/prisma'
import { useRouter } from 'next/router'
import { trpc } from '@/lib/trpc'
@@ -39,7 +39,7 @@ export const WorkspaceProvider = ({
typebotId,
children,
}: WorkspaceContextProps) => {
- const { query } = useRouter()
+ const { pathname, query, push } = useRouter()
const { user } = useUser()
const userId = user?.id
const [workspaceId, setWorkspaceId] = useState
+ You agree not to create or use typebots on Typebot's Website for + the purpose of engaging in fraudulent activities, scamming + individuals, or any other unethical or illegal activities. This + includes but is not limited to typebots designed to deceive, defraud, + or mislead people for financial gain or personal benefit. Typebot + reserves the right to take appropriate action, including the + termination of any user account, if it determines that a typebot is + being used in violation of this provision. +
-Please read our Privacy Policy.
+
+ Please read our{' '}
+
Any claim related to Typebot's Website shall be governed by the
diff --git a/apps/viewer/src/features/chat/api/sendMessage.ts b/apps/viewer/src/features/chat/api/sendMessage.ts
index fe52ea08d..d16407ad8 100644
--- a/apps/viewer/src/features/chat/api/sendMessage.ts
+++ b/apps/viewer/src/features/chat/api/sendMessage.ts
@@ -301,6 +301,7 @@ const getTypebot = async (
additionalChatsIndex: true,
customChatsLimit: true,
isQuarantined: true,
+ isSuspended: true,
},
},
},
@@ -326,12 +327,16 @@ const getTypebot = async (
message: 'Typebot not found',
})
- const isQuarantined =
+ const isQuarantinedOrSuspended =
typebotQuery &&
'typebot' in typebotQuery &&
- typebotQuery.typebot.workspace.isQuarantined
+ (typebotQuery.typebot.workspace.isQuarantined ||
+ typebotQuery.typebot.workspace.isSuspended)
- if (('isClosed' in parsedTypebot && parsedTypebot.isClosed) || isQuarantined)
+ if (
+ ('isClosed' in parsedTypebot && parsedTypebot.isClosed) ||
+ isQuarantinedOrSuspended
+ )
throw new TRPCError({
code: 'BAD_REQUEST',
message: 'Typebot is closed',
diff --git a/packages/prisma/mysql/schema.prisma b/packages/prisma/mysql/schema.prisma
index 8357e1d38..aee67d04a 100644
--- a/packages/prisma/mysql/schema.prisma
+++ b/packages/prisma/mysql/schema.prisma
@@ -97,6 +97,7 @@ model Workspace {
customStorageLimit Int?
customSeatsLimit Int?
isQuarantined Boolean @default(false)
+ isSuspended Boolean @default(false)
themeTemplates ThemeTemplate[]
}
diff --git a/packages/prisma/postgresql/migrations/20230704125011_add_is_suspended_prop/migration.sql b/packages/prisma/postgresql/migrations/20230704125011_add_is_suspended_prop/migration.sql
new file mode 100644
index 000000000..2168029c4
--- /dev/null
+++ b/packages/prisma/postgresql/migrations/20230704125011_add_is_suspended_prop/migration.sql
@@ -0,0 +1,2 @@
+-- AlterTable
+ALTER TABLE "Workspace" ADD COLUMN "isSuspended" BOOLEAN NOT NULL DEFAULT false;
diff --git a/packages/prisma/postgresql/schema.prisma b/packages/prisma/postgresql/schema.prisma
index 291c7a7f1..e71f17f98 100644
--- a/packages/prisma/postgresql/schema.prisma
+++ b/packages/prisma/postgresql/schema.prisma
@@ -91,6 +91,7 @@ model Workspace {
customStorageLimit Int?
customSeatsLimit Int?
isQuarantined Boolean @default(false)
+ isSuspended Boolean @default(false)
themeTemplates ThemeTemplate[]
}
diff --git a/packages/schemas/features/workspace.ts b/packages/schemas/features/workspace.ts
index a4080227a..525f42e83 100644
--- a/packages/schemas/features/workspace.ts
+++ b/packages/schemas/features/workspace.ts
@@ -49,6 +49,7 @@ export const workspaceSchema = z.object({
customStorageLimit: z.number().nullable(),
customSeatsLimit: z.number().nullable(),
isQuarantined: z.boolean(),
+ isSuspended: z.boolean(),
}) satisfies z.ZodType