import { Component, linkEvent } from 'inferno';
+import { Helmet } from 'inferno-helmet';
import { Link } from 'inferno-router';
import { Subscription } from 'rxjs';
import { retryWhen, delay, take } from 'rxjs/operators';
ModAdd,
WebSocketJsonResponse,
GetSiteResponse,
-} from '../interfaces';
+ Site,
+} from 'lemmy-js-client';
import { WebSocketService } from '../services';
import { wsJsonToRes, addTypeInfo, fetchLimit, toast } from '../utils';
import { MomentTime } from './moment-time';
communityId?: number;
communityName?: string;
page: number;
+ site: Site;
loading: boolean;
}
combined: [],
page: 1,
loading: true,
+ site: undefined,
};
constructor(props: any, context: any) {
);
}
+ get documentTitle(): string {
+ if (this.state.site) {
+ return `Modlog - ${this.state.site.name}`;
+ } else {
+ return 'Lemmy';
+ }
+ }
+
render() {
return (
<div class="container">
+ <Helmet title={this.documentTitle} />
{this.state.loading ? (
<h5 class="">
<svg class="icon icon-spinner spin">
this.setCombined(data);
} else if (res.op == UserOperation.GetSite) {
let data = res.data as GetSiteResponse;
- document.title = `Modlog - ${data.site.name}`;
+ this.state.site = data.site;
+ this.setState(this.state);
}
}
}