Skip to content

Commit ccefbff

Browse files
fix(Tenant): make tenant fetch schema only on tenant change
1 parent cc0a2d6 commit ccefbff

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/containers/Tenant/Tenant.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,15 @@ function Tenant(props: TenantProps) {
7878
const tenantName = name as string;
7979

8080
useEffect(() => {
81-
const schemaPath = currentSchemaPath || tenantName;
82-
dispatch(resetLoadingState());
8381
dispatch(getSchema({path: tenantName}));
84-
dispatch(getSchema({path: schemaPath}));
85-
dispatch(getSchemaAcl({path: schemaPath}));
86-
}, [tenantName, currentSchemaPath, dispatch]);
82+
dispatch(getSchemaAcl({path: tenantName}));
83+
}, [tenantName, dispatch]);
84+
85+
useEffect(() => {
86+
dispatch(resetLoadingState());
87+
dispatch(getSchema({path: currentSchemaPath}));
88+
dispatch(getSchemaAcl({path: currentSchemaPath}));
89+
}, [currentSchemaPath, dispatch]);
8790

8891
useEffect(() => {
8992
dispatch(disableAutorefresh());

0 commit comments

Comments
 (0)