mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 06:36:17 +00:00
Rejoin websocket rooms on reconnect. Fixes #41
This commit is contained in:
parent
3ff9b46981
commit
4f5d70d5b5
|
@ -417,6 +417,9 @@ export class Community extends Component<any, State> {
|
||||||
this.context.router.history.push('/');
|
this.context.router.history.push('/');
|
||||||
return;
|
return;
|
||||||
} else if (msg.reconnect) {
|
} else if (msg.reconnect) {
|
||||||
|
WebSocketService.Instance.communityJoin({
|
||||||
|
community_id: this.state.communityRes.community.id,
|
||||||
|
});
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
} else if (res.op == UserOperation.GetCommunity) {
|
} else if (res.op == UserOperation.GetCommunity) {
|
||||||
let data = res.data as GetCommunityResponse;
|
let data = res.data as GetCommunityResponse;
|
||||||
|
|
|
@ -720,6 +720,7 @@ export class Main extends Component<any, MainState> {
|
||||||
toast(i18n.t(msg.error), 'danger');
|
toast(i18n.t(msg.error), 'danger');
|
||||||
return;
|
return;
|
||||||
} else if (msg.reconnect) {
|
} else if (msg.reconnect) {
|
||||||
|
WebSocketService.Instance.communityJoin({ community_id: 0 });
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
} else if (res.op == UserOperation.GetFollowedCommunities) {
|
} else if (res.op == UserOperation.GetFollowedCommunities) {
|
||||||
let data = res.data as GetFollowedCommunitiesResponse;
|
let data = res.data as GetFollowedCommunitiesResponse;
|
||||||
|
|
|
@ -392,6 +392,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else if (msg.reconnect) {
|
} else if (msg.reconnect) {
|
||||||
|
WebSocketService.Instance.userJoin();
|
||||||
this.fetchUnreads();
|
this.fetchUnreads();
|
||||||
} else if (res.op == UserOperation.GetReplies) {
|
} else if (res.op == UserOperation.GetReplies) {
|
||||||
let data = res.data as GetRepliesResponse;
|
let data = res.data as GetRepliesResponse;
|
||||||
|
|
|
@ -436,8 +436,10 @@ export class Post extends Component<any, PostState> {
|
||||||
toast(i18n.t(msg.error), 'danger');
|
toast(i18n.t(msg.error), 'danger');
|
||||||
return;
|
return;
|
||||||
} else if (msg.reconnect) {
|
} else if (msg.reconnect) {
|
||||||
|
let postId = Number(this.props.match.params.id);
|
||||||
|
WebSocketService.Instance.postJoin({ post_id: postId });
|
||||||
WebSocketService.Instance.getPost({
|
WebSocketService.Instance.getPost({
|
||||||
id: Number(this.props.match.params.id),
|
id: postId,
|
||||||
});
|
});
|
||||||
} else if (res.op == UserOperation.GetPost) {
|
} else if (res.op == UserOperation.GetPost) {
|
||||||
let data = res.data as GetPostResponse;
|
let data = res.data as GetPostResponse;
|
||||||
|
|
Loading…
Reference in a new issue