From 84c4b58272020c2aa2cfff6549a734cb1f52e426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sabina=20Gu=C5=A1i=C4=87?= Date: Wed, 7 Jan 2026 18:22:46 +0100 Subject: [PATCH] fix: add 'untagged' tag to bookmarks without tags on creation --- frontend/components/Bookmark/NewBookmarkCard.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/components/Bookmark/NewBookmarkCard.tsx b/frontend/components/Bookmark/NewBookmarkCard.tsx index f5678e82..5820dcfc 100644 --- a/frontend/components/Bookmark/NewBookmarkCard.tsx +++ b/frontend/components/Bookmark/NewBookmarkCard.tsx @@ -104,7 +104,7 @@ export default function NewBookmarkCard() { const handleOnSubmit = async ( submittedBmk: NewBookmarkForm, - actions: any, + actions: any ) => { // Get the last inputted string and all the tags already entered. let tags: Tag[] = strTags.map((t) => ({ title: t, id: -1 })); @@ -112,6 +112,12 @@ export default function NewBookmarkCard() { // FIXME tags.push({ title: tagInput, id: -1 }); } + + // Add default "untagged" tag if user has not provided any + if (!tags.length) { + tags = [{ title: "untagged", id: -1 }]; + } + let newBkmk: Bookmark = { id: -1, title: submittedBmk.title || submittedBmk.url,