Pārlūkot izejas kodu

collection data results should be cleared if we switch between loaded
collection and unloaded collection

Signed-off-by: ryjiang <jiangruiyi@gmail.com>

ryjiang 1 gadu atpakaļ
vecāks
revīzija
27a4abaed5
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  1. 1 0
      client/src/hooks/Query.ts

+ 1 - 0
client/src/hooks/Query.ts

@@ -139,6 +139,7 @@ export const useQuery = (params: {
   // query if expr is changed
   useEffect(() => {
     if (!collection || !collection.loaded) {
+      setQueryResult({ data: [], latency: 0 });
       // console.info('[skip running query]: no key yet');
       return;
     } // reset