Fix #1516 Flakiness in Explore search results. (#1520)

This commit is contained in:
Sachin Chaurasiya 2021-12-03 10:08:00 +05:30 committed by GitHub
parent b7711bf21a
commit 7494b1e4c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -409,6 +409,13 @@ const Explore: React.FC<ExploreProps> = ({
);
};
const getData = () => {
if (!isMounting.current && previsouIndex === getCurrentIndex(tab)) {
forceSetAgg.current = false;
fetchTableData();
}
};
useEffect(() => {
handleSearchText(searchQuery || emptyValue);
setCurrentPage(1);
@ -477,11 +484,16 @@ const Explore: React.FC<ExploreProps> = ({
}, [searchResult]);
useEffect(() => {
if (!isMounting.current && previsouIndex === getCurrentIndex(tab)) {
forceSetAgg.current = false;
fetchTableData();
getData();
}, [currentPage, sortField, sortOrder]);
useEffect(() => {
if (currentPage === 1) {
getData();
} else {
setCurrentPage(1);
}
}, [currentPage, filters, sortField, sortOrder]);
}, [filters]);
// alwyas Keep this useEffect at the end...
useEffect(() => {