Merge branch 'feature/workspaces' of https://github.com/ONLYOFFICE/AppServer into feature/workspaces

This commit is contained in:
Nikita Gopienko 2021-03-10 16:44:35 +03:00
commit b88d1d989c

View File

@ -104,7 +104,6 @@ class Customization extends React.Component {
setDocumentTitle(t("Customization")); setDocumentTitle(t("Customization"));
this.state = { this.state = {
isLoadedData: false,
isLoading: false, isLoading: false,
timezones, timezones,
timezone: findSelectedItemByKey( timezone: findSelectedItemByKey(
@ -129,7 +128,7 @@ class Customization extends React.Component {
t, t,
getPortalTimezones, getPortalTimezones,
} = this.props; } = this.props;
const { timezones, languages, isLoadedData } = this.state; const { timezones, languages } = this.state;
if (!timezones.length && !languages.length) { if (!timezones.length && !languages.length) {
let languages; let languages;
@ -148,19 +147,11 @@ class Customization extends React.Component {
this.setState({ languages, language, timezones, timezone }); this.setState({ languages, language, timezones, timezone });
}); });
} }
if (timezones.length && languages.length && !isLoadedData) {
this.setState({ isLoadedData: true });
}
} }
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps) {
const { timezones, languages } = this.state;
const { i18n, language, nameSchemaId, getCurrentCustomSchema } = this.props; const { i18n, language, nameSchemaId, getCurrentCustomSchema } = this.props;
if (timezones.length && languages.length && !prevState.isLoadedData) {
this.setState({ isLoadedData: true });
}
if (language !== prevProps.language) { if (language !== prevProps.language) {
changeLanguage(i18n) changeLanguage(i18n)
.then((t) => { .then((t) => {
@ -211,11 +202,8 @@ class Customization extends React.Component {
render() { render() {
const { t } = this.props; const { t } = this.props;
const { isLoadedData, language, timezone } = this.state; const { language, timezone } = this.state;
return !isLoadedData ? ( return (
<Loader className="pageLoader" type="rombs" size="40px" />
) : (
<>
<StyledComponent> <StyledComponent>
<div className="category-item-wrapper"> <div className="category-item-wrapper">
<div className="category-item-heading"> <div className="category-item-heading">
@ -255,7 +243,6 @@ class Customization extends React.Component {
</Text> </Text>
</div> </div>
</StyledComponent> </StyledComponent>
</>
); );
} }
} }