From: Dessalines Date: Wed, 27 Apr 2022 19:09:36 +0000 (-0400) Subject: Fixing initial loading of admin page. Fixes #635 (#638) X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/nerdica.net/%7Bthis.props.imageSrc%7D?a=commitdiff_plain;h=2d1111fa74fc2697b57f0128205d24d69fbc639c;p=lemmy-ui.git Fixing initial loading of admin page. Fixes #635 (#638) --- diff --git a/src/shared/components/home/admin-settings.tsx b/src/shared/components/home/admin-settings.tsx index 284805b..b98da1f 100644 --- a/src/shared/components/home/admin-settings.tsx +++ b/src/shared/components/home/admin-settings.tsx @@ -35,7 +35,7 @@ import { SiteForm } from "./site-form"; interface AdminSettingsState { siteRes: GetSiteResponse; siteConfigRes: GetSiteConfigResponse; - siteConfigForm: SaveSiteConfig; + siteConfigHjson: string; loading: boolean; banned: PersonViewSafe[]; siteConfigLoading: boolean; @@ -48,10 +48,7 @@ export class AdminSettings extends Component { private subscription: Subscription; private emptyState: AdminSettingsState = { siteRes: this.isoData.site_res, - siteConfigForm: { - config_hjson: null, - auth: null, - }, + siteConfigHjson: null, siteConfigRes: { config_hjson: null, }, @@ -72,13 +69,11 @@ export class AdminSettings extends Component { // Only fetch the data if coming from another route if (this.isoData.path == this.context.router.route.match.url) { this.state.siteConfigRes = this.isoData.routeData[0]; - this.state.siteConfigForm.config_hjson = - this.state.siteConfigRes.config_hjson; + this.state.siteConfigHjson = this.state.siteConfigRes.config_hjson; this.state.banned = this.isoData.routeData[1].banned; this.state.siteConfigLoading = false; this.state.loading = false; } else { - this.state.siteConfigForm.auth = authField(); WebSocketService.Instance.send( wsClient.getSiteConfig({ auth: authField(), @@ -211,7 +206,7 @@ export class AdminSettings extends Component {