summaryrefslogtreecommitdiffstats
path: root/ui/src/components/communities.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/components/communities.tsx')
-rw-r--r--ui/src/components/communities.tsx14
1 files changed, 6 insertions, 8 deletions
diff --git a/ui/src/components/communities.tsx b/ui/src/components/communities.tsx
index a3e340ff..10a3ab80 100644
--- a/ui/src/components/communities.tsx
+++ b/ui/src/components/communities.tsx
@@ -1,5 +1,4 @@
import { Component, linkEvent } from 'inferno';
-import { Link } from 'inferno-router';
import { Subscription } from 'rxjs';
import { retryWhen, delay, take } from 'rxjs/operators';
import {
@@ -11,6 +10,7 @@ import {
ListCommunitiesForm,
SortType,
WebSocketJsonResponse,
+ GetSiteResponse,
} from '../interfaces';
import { WebSocketService } from '../services';
import { wsJsonToRes, toast } from '../utils';
@@ -47,6 +47,7 @@ export class Communities extends Component<any, CommunitiesState> {
);
this.refetch();
+ WebSocketService.Instance.getSite();
}
getPageFromProps(props: any): number {
@@ -57,12 +58,6 @@ export class Communities extends Component<any, CommunitiesState> {
this.subscription.unsubscribe();
}
- componentDidMount() {
- document.title = `${i18n.t('communities')} - ${
- WebSocketService.Instance.site.name
- }`;
- }
-
// Necessary for back button for some reason
componentWillReceiveProps(nextProps: any) {
if (nextProps.history.action == 'POP') {
@@ -165,7 +160,7 @@ export class Communities extends Component<any, CommunitiesState> {
</button>
)}
- {this.state.communities.length == communityLimit && (
+ {this.state.communities.length > 0 && (
<button
class="btn btn-sm btn-secondary"
onClick={linkEvent(this, this.nextPage)}
@@ -244,6 +239,9 @@ export class Communities extends Component<any, CommunitiesState> {
found.subscribed = data.community.subscribed;
found.number_of_subscribers = data.community.number_of_subscribers;
this.setState(this.state);
+ } else if (res.op == UserOperation.GetSite) {
+ let data = res.data as GetSiteResponse;
+ document.title = `${i18n.t('communities')} - ${data.site.name}`;
}
}
}