diff options
Diffstat (limited to 'ui/src/components/communities.tsx')
-rw-r--r-- | ui/src/components/communities.tsx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ui/src/components/communities.tsx b/ui/src/components/communities.tsx index c3cde177..b81b11cd 100644 --- a/ui/src/components/communities.tsx +++ b/ui/src/components/communities.tsx @@ -2,9 +2,9 @@ import { Component, linkEvent } from 'inferno'; import { Link } from 'inferno-router'; import { Subscription } from "rxjs"; import { retryWhen, delay, take } from 'rxjs/operators'; -import { UserOperation, Community, Post as PostI, GetPostResponse, PostResponse, Comment, CommentForm as CommentFormI, CommentResponse, CommentLikeForm, CommentSortType, CreatePostLikeResponse, ListCommunitiesResponse, CommunityResponse, FollowCommunityForm } from '../interfaces'; -import { WebSocketService, UserService } from '../services'; -import { msgOp, hotRank,mdToHtml } from '../utils'; +import { UserOperation, Community, ListCommunitiesResponse, CommunityResponse, FollowCommunityForm } from '../interfaces'; +import { WebSocketService } from '../services'; +import { msgOp } from '../utils'; declare const Sortable: any; @@ -18,7 +18,7 @@ export class Communities extends Component<any, CommunitiesState> { communities: [] } - constructor(props, context) { + constructor(props: any, context: any) { super(props, context); this.state = this.emptyState; this.subscription = WebSocketService.Instance.subject @@ -32,6 +32,10 @@ export class Communities extends Component<any, CommunitiesState> { } + componentWillUnmount() { + this.subscription.unsubscribe(); + } + componentDidMount() { let table = document.querySelector('#community_table'); Sortable.initTable(table); |