summaryrefslogtreecommitdiffstats
path: root/ui/src/components/modlog.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/components/modlog.tsx')
-rw-r--r--ui/src/components/modlog.tsx9
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/src/components/modlog.tsx b/ui/src/components/modlog.tsx
index 04628ebd..9a5131c9 100644
--- a/ui/src/components/modlog.tsx
+++ b/ui/src/components/modlog.tsx
@@ -16,6 +16,7 @@ import {
ModAddCommunity,
ModAdd,
WebSocketJsonResponse,
+ GetSiteResponse,
} from '../interfaces';
import { WebSocketService } from '../services';
import { wsJsonToRes, addTypeInfo, fetchLimit, toast } from '../utils';
@@ -64,16 +65,13 @@ export class Modlog extends Component<any, ModlogState> {
);
this.refetch();
+ WebSocketService.Instance.getSite();
}
componentWillUnmount() {
this.subscription.unsubscribe();
}
- componentDidMount() {
- document.title = `Modlog - ${WebSocketService.Instance.site.name}`;
- }
-
setCombined(res: GetModlogResponse) {
let removed_posts = addTypeInfo(res.removed_posts, 'removed_posts');
let locked_posts = addTypeInfo(res.locked_posts, 'locked_posts');
@@ -434,6 +432,9 @@ export class Modlog extends Component<any, ModlogState> {
this.state.loading = false;
window.scrollTo(0, 0);
this.setCombined(data);
+ } else if (res.op == UserOperation.GetSite) {
+ let data = res.data as GetSiteResponse;
+ document.title = `Modlog - ${data.site.name}`;
}
}
}