From ccfff6b1954030a273b0612f3772ec00a82422c8 Mon Sep 17 00:00:00 2001 From: Md Saban <45597394+mdsaban@users.noreply.github.com> Date: Sat, 22 Jun 2024 21:20:14 +0530 Subject: fix(web): Fix save action on empty card. Fixes #225 (#243) * fix: Empty item save action * fix: resolve comments * chore: prettier --- apps/web/components/dashboard/bookmarks/EditorCard.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'apps/web/components/dashboard/bookmarks/EditorCard.tsx') diff --git a/apps/web/components/dashboard/bookmarks/EditorCard.tsx b/apps/web/components/dashboard/bookmarks/EditorCard.tsx index 3006a964..a1055e8e 100644 --- a/apps/web/components/dashboard/bookmarks/EditorCard.tsx +++ b/apps/web/components/dashboard/bookmarks/EditorCard.tsx @@ -13,7 +13,7 @@ import { useBookmarkLayout, useBookmarkLayoutSwitch, } from "@/lib/userLocalSettings/bookmarksLayout"; -import { cn } from "@/lib/utils"; +import { cn, getOS } from "@/lib/utils"; import { zodResolver } from "@hookform/resolvers/zod"; import { useForm } from "react-hook-form"; import { z } from "zod"; @@ -123,6 +123,7 @@ export default function EditorCard({ className }: { className?: string }) { const onSubmit: SubmitHandler> = (data) => { const text = data.text.trim(); + if (!text.length) return; try { tryToImportUrls(text); } catch (e) { @@ -162,12 +163,14 @@ export default function EditorCard({ className }: { className?: string }) { } }; + const OS = getOS(); + return (
-- cgit v1.2.3-70-g09d2