Web: Files: fixed render loader
This commit is contained in:
parent
e2bb4a8405
commit
2623c91e80
@ -11,6 +11,7 @@ import { SectionHeaderContent, SectionBodyContent } from "./Section";
|
|||||||
import { withTranslation, I18nextProvider } from "react-i18next";
|
import { withTranslation, I18nextProvider } from "react-i18next";
|
||||||
import { createI18N } from "../../../helpers/i18n";
|
import { createI18N } from "../../../helpers/i18n";
|
||||||
import { getFilesSettings, setIsLoading } from "../../../store/files/actions";
|
import { getFilesSettings, setIsLoading } from "../../../store/files/actions";
|
||||||
|
import { getSettingsTree } from "../../../store/files/selectors";
|
||||||
|
|
||||||
const i18n = createI18N({
|
const i18n = createI18N({
|
||||||
page: "Settings",
|
page: "Settings",
|
||||||
@ -23,6 +24,7 @@ const PureSettings = ({
|
|||||||
match,
|
match,
|
||||||
t,
|
t,
|
||||||
isLoading,
|
isLoading,
|
||||||
|
settingsTree,
|
||||||
getFilesSettings,
|
getFilesSettings,
|
||||||
setIsLoading,
|
setIsLoading,
|
||||||
}) => {
|
}) => {
|
||||||
@ -62,7 +64,7 @@ const PureSettings = ({
|
|||||||
</PageLayout.ArticleBody>
|
</PageLayout.ArticleBody>
|
||||||
|
|
||||||
<PageLayout.SectionHeader>
|
<PageLayout.SectionHeader>
|
||||||
{isLoading ? (
|
{Object.keys(settingsTree).length === 0 ? (
|
||||||
<Loaders.Headline />
|
<Loaders.Headline />
|
||||||
) : (
|
) : (
|
||||||
<SectionHeaderContent setting={setting} t={t} />
|
<SectionHeaderContent setting={setting} t={t} />
|
||||||
@ -70,7 +72,7 @@ const PureSettings = ({
|
|||||||
</PageLayout.SectionHeader>
|
</PageLayout.SectionHeader>
|
||||||
|
|
||||||
<PageLayout.SectionBody>
|
<PageLayout.SectionBody>
|
||||||
{isLoading ? (
|
{Object.keys(settingsTree).length === 0 ? (
|
||||||
<Loaders.SettingsFiles />
|
<Loaders.SettingsFiles />
|
||||||
) : (
|
) : (
|
||||||
<SectionBodyContent setting={setting} t={t} />
|
<SectionBodyContent setting={setting} t={t} />
|
||||||
@ -97,6 +99,7 @@ const Settings = (props) => {
|
|||||||
function mapStateToProps(state) {
|
function mapStateToProps(state) {
|
||||||
return {
|
return {
|
||||||
isLoading: state.files.isLoading,
|
isLoading: state.files.isLoading,
|
||||||
|
settingsTree: getSettingsTree(state),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user