Fix error during new site setup (#596)

* Fix error during new site setup

* remove logging
This commit is contained in:
Nutomic 2022-03-14 20:11:21 +00:00 committed by GitHub
parent 3fe9dc0d7b
commit 0619b162d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -28,7 +28,7 @@ export class App extends Component<AppProps, any> {
<div>
<Theme
myUserInfo={siteRes.my_user}
defaultTheme={siteRes.site_view.site.default_theme}
defaultTheme={siteRes?.site_view?.site?.default_theme}
/>
{siteRes &&
siteRes.site_view &&

View file

@ -4,7 +4,7 @@ import { MyUserInfo } from "lemmy-js-client";
interface Props {
myUserInfo: MyUserInfo | undefined;
defaultTheme: string;
defaultTheme?: string;
}
export class Theme extends Component<Props> {
@ -22,7 +22,10 @@ export class Theme extends Component<Props> {
/>
</Helmet>
);
} else if (this.props.defaultTheme != "browser") {
} else if (
this.props.defaultTheme != null &&
this.props.defaultTheme != "browser"
) {
return (
<Helmet>
<link