* Adding block from community sidebar. Fixes #690 * Fixing lint
This commit is contained in:
parent
b2cab8d126
commit
e68babe38b
2 changed files with 62 additions and 13 deletions
|
@ -3,6 +3,7 @@ import { Component, linkEvent } from "inferno";
|
|||
import {
|
||||
AddModToCommunityResponse,
|
||||
BanFromCommunityResponse,
|
||||
BlockCommunityResponse,
|
||||
BlockPersonResponse,
|
||||
CommentReportResponse,
|
||||
CommentResponse,
|
||||
|
@ -53,6 +54,7 @@ import {
|
|||
setupTippy,
|
||||
showLocal,
|
||||
toast,
|
||||
updateCommunityBlock,
|
||||
updatePersonBlock,
|
||||
wsClient,
|
||||
wsSubscribe,
|
||||
|
@ -663,6 +665,17 @@ export class Community extends Component<any, State> {
|
|||
toast(i18n.t("purge_success"));
|
||||
this.context.router.history.push(`/`);
|
||||
}
|
||||
} else if (op == UserOperation.BlockCommunity) {
|
||||
let data = wsJsonToRes<BlockCommunityResponse>(
|
||||
msg,
|
||||
BlockCommunityResponse
|
||||
);
|
||||
this.state.communityRes.match({
|
||||
some: res => (res.community_view.blocked = data.blocked),
|
||||
none: void 0,
|
||||
});
|
||||
updateCommunityBlock(data);
|
||||
this.setState(this.state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue