浏览代码

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

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

ryjiang 1 年之前
父节点
当前提交
27a4abaed5
共有 1 个文件被更改,包括 1 次插入0 次删除
  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