From b9193a556260fa519e35b76b9fbd2c874b40f71d Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 24 Aug 2025 16:41:44 +0300 Subject: [PATCH] chore(react/ribbon): handle search error --- apps/client/src/services/attributes.ts | 2 +- .../client/src/widgets/react/FormTextArea.tsx | 6 ++- apps/client/src/widgets/react/hooks.tsx | 6 ++- .../widgets/ribbon/SearchDefinitionTab.tsx | 48 ++++++++++++++----- .../widgets/search_options/search_string.ts | 32 ------------- 5 files changed, 46 insertions(+), 48 deletions(-) diff --git a/apps/client/src/services/attributes.ts b/apps/client/src/services/attributes.ts index 91ebbff5c..0b605f5bd 100644 --- a/apps/client/src/services/attributes.ts +++ b/apps/client/src/services/attributes.ts @@ -61,7 +61,7 @@ function removeOwnedLabelByName(note: FNote, labelName: string) { * @param value the value of the attribute to set. */ export async function setAttribute(note: FNote, type: "label" | "relation", name: string, value: string | null | undefined) { - if (value) { + if (value !== null && value !== undefined) { // Create or update the attribute. await server.put(`notes/${note.noteId}/set-attribute`, { type, name, value }); } else { diff --git a/apps/client/src/widgets/react/FormTextArea.tsx b/apps/client/src/widgets/react/FormTextArea.tsx index d15fb879c..354a02b4e 100644 --- a/apps/client/src/widgets/react/FormTextArea.tsx +++ b/apps/client/src/widgets/react/FormTextArea.tsx @@ -1,4 +1,4 @@ -import { TextareaHTMLAttributes } from "preact/compat"; +import { RefObject, TextareaHTMLAttributes } from "preact/compat"; interface FormTextAreaProps extends Omit { id?: string; @@ -6,10 +6,12 @@ interface FormTextAreaProps extends Omit } -export default function FormTextArea({ id, onBlur, onChange, rows, currentValue, className, ...restProps }: FormTextAreaProps) { +export default function FormTextArea({ inputRef, id, onBlur, onChange, rows, currentValue, className, ...restProps }: FormTextAreaProps) { return (