diff options
author | Dessalines <tyhou13@gmx.com> | 2019-08-23 19:40:41 -0700 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2019-08-23 19:40:41 -0700 |
commit | 3561ef93a08742c74f36609754b87f2cd4a84e1c (patch) | |
tree | d6a1a5a6823bfee68a3e6bbbea9031f597bdb79b /ui/src/components/post.tsx | |
parent | d5b9ba724dbab8ac1b17ca52d3f85309e5f22497 (diff) |
Adding Community and Site transfer
- Fixes #139
Diffstat (limited to 'ui/src/components/post.tsx')
-rw-r--r-- | ui/src/components/post.tsx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ui/src/components/post.tsx b/ui/src/components/post.tsx index ab82ca4f..a6df4105 100644 --- a/ui/src/components/post.tsx +++ b/ui/src/components/post.tsx @@ -1,7 +1,7 @@ import { Component, linkEvent } from 'inferno'; import { Subscription } from "rxjs"; import { retryWhen, delay, take } from 'rxjs/operators'; -import { UserOperation, Community, Post as PostI, GetPostResponse, PostResponse, Comment, CommentForm as CommentFormI, CommentResponse, CommentSortType, CreatePostLikeResponse, CommunityUser, CommunityResponse, CommentNode as CommentNodeI, BanFromCommunityResponse, BanUserResponse, AddModToCommunityResponse, AddAdminResponse, UserView, SearchType, SortType, SearchForm, SearchResponse } from '../interfaces'; +import { UserOperation, Community, Post as PostI, GetPostResponse, PostResponse, Comment, CommentForm as CommentFormI, CommentResponse, CommentSortType, CreatePostLikeResponse, CommunityUser, CommunityResponse, CommentNode as CommentNodeI, BanFromCommunityResponse, BanUserResponse, AddModToCommunityResponse, AddAdminResponse, UserView, SearchType, SortType, SearchForm, SearchResponse, GetSiteResponse, GetCommunityResponse } from '../interfaces'; import { WebSocketService, UserService } from '../services'; import { msgOp, hotRank } from '../utils'; import { PostListing } from './post-listing'; @@ -370,6 +370,17 @@ export class Post extends Component<any, PostState> { let res: SearchResponse = msg; this.state.crossPosts = res.posts.filter(p => p.id != this.state.post.id); this.setState(this.state); + } else if (op == UserOperation.TransferSite) { + let res: GetSiteResponse = msg; + + this.state.admins = res.admins; + this.setState(this.state); + } else if (op == UserOperation.TransferCommunity) { + let res: GetCommunityResponse = msg; + this.state.community = res.community; + this.state.moderators = res.moderators; + this.state.admins = res.admins; + this.setState(this.state); } } |