- handlePurgeSubmit(i: Sidebar, event: any) {
- event.preventDefault();
+ // TODO Do we need two of these?
+ handleUnfollowCommunity(i: Sidebar) {
+ i.setState({ followCommunityLoading: true });
+ i.props.onFollowCommunity({
+ community_id: i.props.community_view.community.id,
+ follow: false,
+ auth: myAuthRequired(),
+ });
+ }
+
+ handleFollowCommunity(i: Sidebar) {
+ i.setState({ followCommunityLoading: true });
+ i.props.onFollowCommunity({
+ community_id: i.props.community_view.community.id,
+ follow: true,
+ auth: myAuthRequired(),
+ });
+ }
+
+ handleBlockCommunity(i: Sidebar) {
+ i.setState({ blockCommunityLoading: true });
+ i.props.onBlockCommunity({
+ community_id: 0,
+ block: !i.props.community_view.blocked,
+ auth: myAuthRequired(),
+ });
+ }