Web:Client:Add isLoadedSectionHeader.

This commit is contained in:
Vlada Gazizova 2022-09-21 12:29:17 +03:00
parent 1e0d70a229
commit 47b859717e

View File

@ -135,11 +135,9 @@ class SectionHeaderContent extends React.Component {
}
componentDidUpdate() {
const { isLoaded, tReady, setIsLoadedSectionHeader } = this.props;
const { tReady, setIsLoadedSectionHeader } = this.props;
const isLoadedSetting = isLoaded && tReady;
if (isLoadedSetting) setIsLoadedSectionHeader(isLoadedSetting);
if (tReady) setIsLoadedSectionHeader(true);
const arrayOfParams = this.getArrayOfParams();
@ -218,7 +216,7 @@ class SectionHeaderContent extends React.Component {
render() {
const {
t,
tReady,
isLoadedSectionHeader,
addUsers,
isHeaderIndeterminate,
isHeaderChecked,
@ -248,8 +246,6 @@ class SectionHeaderContent extends React.Component {
},
];
const showLoader = !tReady;
return (
<StyledContainer isHeaderVisible={isHeaderVisible}>
{isHeaderVisible ? (
@ -262,7 +258,7 @@ class SectionHeaderContent extends React.Component {
headerMenu={headerMenu}
/>
</div>
) : showLoader ? (
) : !isLoadedSectionHeader ? (
<LoaderSectionHeader />
) : (
<HeaderContainer>
@ -311,7 +307,7 @@ export default inject(({ auth, setup, common }) => {
selection,
} = setup.selectionStore;
const { admins, selectorIsOpen } = setup.security.accessRight;
const { isLoaded, setIsLoadedSectionHeader } = common;
const { isLoadedSectionHeader, setIsLoadedSectionHeader } = common;
return {
addUsers,
removeAdmins,
@ -327,7 +323,7 @@ export default inject(({ auth, setup, common }) => {
toggleSelector,
selectorIsOpen,
selection,
isLoaded,
isLoadedSectionHeader,
setIsLoadedSectionHeader,
};
})(