From b0c4058773eedc3a521e895a6499854371864bcb Mon Sep 17 00:00:00 2001 From: Bogdan Arabadzhi <8407846+barabadzhi@users.noreply.github.com> Date: Fri, 3 Jan 2025 09:53:20 +0100 Subject: [PATCH] Forms: remove programmatic highlight of the object (#245) --- .../forms/routes/formsList/formsList.tsx | 49 ++++++++++--------- src/features/forms/routes/object.tsx | 18 ++----- 2 files changed, 29 insertions(+), 38 deletions(-) diff --git a/src/features/forms/routes/formsList/formsList.tsx b/src/features/forms/routes/formsList/formsList.tsx index 93672f79..1aa07e1a 100644 --- a/src/features/forms/routes/formsList/formsList.tsx +++ b/src/features/forms/routes/formsList/formsList.tsx @@ -357,33 +357,36 @@ export function FormsList() { - {(loadingTemplate || loadingItems) && ( + {loadingTemplate || loadingItems ? ( - )} - - {template?.title.value ?? ""} - - - {items.length === 0 ? ( - {t("noForms")} - ) : ( - - {({ height }) => ( - - {ListItem} - + ) : ( + <> + + {template?.title.value ?? ""} + + + {items.length === 0 ? ( + {t("noForms")} + ) : ( + + {({ height }) => ( + + {ListItem} + + )} + )} - - )} - + + + )} { - if (!id || highlighted.includes(+id)) { - return; - } - dispatchHighlighted(highlightActions.setIds([+id])); - }, [dispatchHighlighted, id, highlighted]); - - const { - data: forms, - isLoading: formsLoading, - isUninitialized, - } = useGetSearchFormsQuery( + const { data: forms = [], isLoading: formsLoading } = useGetSearchFormsQuery( object?.guid ? { projectId: sceneId, @@ -147,7 +135,7 @@ export function Object() { - {isLoading || formsLoading || isUninitialized ? ( + {isLoading || formsLoading ? (