Skip to content

Commit 2d86044

Browse files
committed
fix(Tenant): load root if cahced path is not in tree
1 parent 161bc8d commit 2d86044

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/containers/Tenant/Schema/SchemaTree/SchemaTree.tsx

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {useEffect} from 'react';
12
import {useDispatch} from 'react-redux';
23

34
import {NavigationTree} from 'ydb-ui-components';
@@ -48,6 +49,13 @@ export function SchemaTree(props: SchemaTreeProps) {
4849
dispatch(getSchemaAcl({path: activePath}));
4950
};
5051

52+
useEffect(() => {
53+
// if the cached path is not in the current tree, show root
54+
if (!currentPath.startsWith(rootPath)) {
55+
handleActivePathUpdate(rootPath);
56+
}
57+
}, []);
58+
5159
return (
5260
<NavigationTree
5361
rootState={{

0 commit comments

Comments
 (0)