Browse Source

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

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

ryjiang 1 year ago
parent
commit
27a4abaed5
1 changed files with 1 additions and 0 deletions
  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