From 82b781a1cf706389e736203fa1e0a190dc223005 Mon Sep 17 00:00:00 2001 From: jhweir Date: Fri, 20 Dec 2024 12:51:19 +0000 Subject: [PATCH] allEntries readded in useSubjects --- ad4m-hooks/react/src/useSubjects.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ad4m-hooks/react/src/useSubjects.tsx b/ad4m-hooks/react/src/useSubjects.tsx index f1cec6b7f..9b1401999 100644 --- a/ad4m-hooks/react/src/useSubjects.tsx +++ b/ad4m-hooks/react/src/useSubjects.tsx @@ -83,7 +83,7 @@ export function useSubjects(props: Props) { const newEntries = isOldEntry ? oldEntries?.map((oldEntry) => { - // @ts-ignore + // @ts-ignore const isUpdatedEntry = id === oldEntry.id; return isUpdatedEntry ? entry : oldEntry; }) @@ -97,8 +97,8 @@ export function useSubjects(props: Props) { timeout.current = setTimeout(getData, 1000); const isNewEntry = link.data.source === source; - // @ts-ignore - const isUpdated = allEntries?.find((e) => e.id === link.data.source); + const allEntries = (getCache(cacheKey) || []) as SubjectClass[]; + const isUpdated = allEntries?.find((e: any) => e.id === link.data.source); const id = isNewEntry ? link.data.target