Skip to content

Commit 3bd1e5d

Browse files
RaubzeugElena Makarova
andauthored
fix(Tenant): should not duplicate api requests (#879)
Co-authored-by: Elena Makarova <[email protected]>
1 parent 3124bdb commit 3bd1e5d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/containers/Tenant/Tenant.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,11 @@ function Tenant(props: TenantProps) {
9494
}, [tenantName, dispatch]);
9595

9696
React.useEffect(() => {
97-
if (currentSchemaPath) {
97+
//TODO: should be refactored when move to @reduxjs/toolkit/query
98+
if (currentSchemaPath && currentSchemaPath !== tenantName) {
9899
dispatch(getSchema({path: currentSchemaPath}));
99100
}
100-
}, [currentSchemaPath, dispatch]);
101+
}, [currentSchemaPath, dispatch, tenantName]);
101102

102103
React.useEffect(() => {
103104
if (tenantName) {

0 commit comments

Comments
 (0)