소스 검색

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