Skip to content

Commit

Permalink
on umount stop loading
Browse files Browse the repository at this point in the history
Signed-off-by: Shenoy Pratik <[email protected]>
  • Loading branch information
ps48 committed Mar 20, 2024
1 parent 2684b6f commit bcb9c7a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions public/components/SQLPage/sql_catalog_tree/s3_tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ export const S3Tree = ({ dataSource, updateSQLQueries, refreshTree }: S3TreeProp
const {
loadStatus: loadDatabasesStatus,
startLoading: startDatabasesLoading,
stopLoading: _stopDatabasesLoading,
stopLoading: stopDatabasesLoading,
} = catalogCacheRefs.useLoadDatabasesToCache();
const {
loadStatus: loadTablesStatus,
startLoading: startLoadingTables,
stopLoading: _stopLoadingTables,
stopLoading: stopLoadingTables,
} = catalogCacheRefs.useLoadTablesToCache();
const {
loadStatus: loadAccelerationsStatus,
startLoading: startLoadingAccelerations,
stopLoading: _stopLoadingAccelerations,
stopLoading: stopLoadingAccelerations,
} = catalogCacheRefs.useLoadAccelerationsToCache();

const updateDatabaseState = (databaseName: string, isLoading: boolean, values?: TreeItem[]) => {
Expand Down Expand Up @@ -274,6 +274,14 @@ export const S3Tree = ({ dataSource, updateSQLQueries, refreshTree }: S3TreeProp
}
}, [isObjectLoading]);

useEffect(() => {
return () => {
stopDatabasesLoading();
stopLoadingTables();
stopLoadingAccelerations();
};
}, []);

const treeLoadingStateRenderer = (
<EuiFlexGroup alignItems="center" gutterSize="s" direction="column">
<EuiSpacer />
Expand Down

0 comments on commit bcb9c7a

Please sign in to comment.