Handle noDaemon case for App

This commit is contained in:
infinite-persistence 2021-08-09 09:08:36 +08:00
parent aba9198844
commit d3fde729f5
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -39,8 +39,7 @@ class SettingsPage extends React.PureComponent<Props> {
const { daemonSettings, isAuthenticated } = this.props;
const noDaemonSettings = !daemonSettings || Object.keys(daemonSettings).length === 0;
const newStyle = true;
return newStyle ? (
return (
<Page noFooter noSideNavigation backout={{ title: __('Settings'), backLabel: __('Done') }} className="card-stack">
{!isAuthenticated && IS_WEB && (
<>
@ -60,28 +59,18 @@ class SettingsPage extends React.PureComponent<Props> {
</>
)}
{!IS_WEB && noDaemonSettings ? (
<section className="card card--section">
<div className="card__title card__title--deprecated">{__('Failed to load settings.')}</div>
</section>
) : (
<div className={classnames('card-stack', { 'card--disabled': IS_WEB && !isAuthenticated })}>
<SettingAppearance />
<SettingAccount />
<SettingContent />
<SettingSystem />
</div>
</Page>
) : (
<Page
noFooter
noSideNavigation
backout={{
title: __('Settings'),
backLabel: __('Done'),
}}
className="card-stack"
>
{!IS_WEB && noDaemonSettings ? (
<section className="card card--section">
<div className="card__title card__title--deprecated">{__('Failed to load settings.')}</div>
</section>
) : null}
)}
</Page>
);
}