From 2576b30ec10482144abdd8493da2a3d26246e4da Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 30 Nov 2024 16:01:22 +0100 Subject: [PATCH] Fix participations --- client/src/ui/screens/Home.tsx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/client/src/ui/screens/Home.tsx b/client/src/ui/screens/Home.tsx index 51edf8a..5936bdc 100644 --- a/client/src/ui/screens/Home.tsx +++ b/client/src/ui/screens/Home.tsx @@ -96,6 +96,28 @@ export const Home = () => { syncEntities(); }, [account?.address]); + // fetch here because Partictipation has double keys + useEffect(() => { + const clause: torii.KeysClause = { + keys: [undefined, undefined], + pattern_matching: "FixedLen", + models: ["zkube-Participation"], + }; + + const syncEntities = async () => { + await getSyncEntities( + toriiClient, + contractComponents as any, + { Keys: clause }, + [], + 10_000, + false, + ); + }; + + syncEntities(); + }, [account?.address]); + const isMdOrLarger = useMediaQuery({ query: "(min-width: 768px)" }); // State variables for modals