From 1134de6c1d03b16a3ed574b2fe24228f2b51ba77 Mon Sep 17 00:00:00 2001 From: Misha Holtz <36575242+mnholtz@users.noreply.github.com> Date: Fri, 15 Nov 2024 13:34:22 -0800 Subject: [PATCH] don't throw if assetDatabase is not uuid --- .../src/components/formBuilder/widgets/RichTextWidget.tsx | 4 ++-- .../src/components/richTextEditor/RichTextEditor.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/browser-extension/src/components/formBuilder/widgets/RichTextWidget.tsx b/applications/browser-extension/src/components/formBuilder/widgets/RichTextWidget.tsx index 61c19c4654..6b15565abc 100644 --- a/applications/browser-extension/src/components/formBuilder/widgets/RichTextWidget.tsx +++ b/applications/browser-extension/src/components/formBuilder/widgets/RichTextWidget.tsx @@ -18,7 +18,7 @@ import React from "react"; import { type WidgetProps } from "@rjsf/utils"; import RichTextEditor from "@/components/richTextEditor/RichTextEditor"; -import { validateUUID } from "@/types/helpers"; +import {isUUID} from "@/types/helpers"; const RichTextWidget: React.FunctionComponent = ({ id, @@ -45,7 +45,7 @@ const RichTextWidget: React.FunctionComponent = ({ onBlur(id, editor.getHTML()); }} editable={!(disabled || readonly)} - assetDatabaseId={validateUUID(database)} + assetDatabaseId={typeof database === "string" && isUUID(database) ? database : null} content={typeof value === "string" ? value : ""} /> ); diff --git a/applications/browser-extension/src/components/richTextEditor/RichTextEditor.tsx b/applications/browser-extension/src/components/richTextEditor/RichTextEditor.tsx index 867cfaa247..2c647c93dd 100644 --- a/applications/browser-extension/src/components/richTextEditor/RichTextEditor.tsx +++ b/applications/browser-extension/src/components/richTextEditor/RichTextEditor.tsx @@ -29,7 +29,7 @@ import ErrorToast from "@/components/richTextEditor/ErrorToast"; type EditorProps = EditorProviderProps & { // A PixieBrix asset database ID to use for uploading images. If not included, the image extension will be disabled. - assetDatabaseId?: UUID; + assetDatabaseId?: UUID | null; }; interface ImageWithAssetDatabaseOptions extends ImageOptions {