summaryrefslogtreecommitdiffstats
path: root/ui/src/components/post-listings.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-04-17 16:31:08 -0700
committerDessalines <tyhou13@gmx.com>2019-04-17 16:31:08 -0700
commit3f0ba128bdbd58d9c9f5576eddba04b54735ae31 (patch)
treeb61bd7e72f5e16cc34659eeba7ff67a21bb856be /ui/src/components/post-listings.tsx
parent1f657cbdbae6abcedb583bd5142b15ebc16d265b (diff)
Fixing a bug with community pages
Diffstat (limited to 'ui/src/components/post-listings.tsx')
-rw-r--r--ui/src/components/post-listings.tsx18
1 files changed, 2 insertions, 16 deletions
diff --git a/ui/src/components/post-listings.tsx b/ui/src/components/post-listings.tsx
index 224f92ce..8fc19b30 100644
--- a/ui/src/components/post-listings.tsx
+++ b/ui/src/components/post-listings.tsx
@@ -2,7 +2,7 @@ import { Component, linkEvent } from 'inferno';
import { Link } from 'inferno-router';
import { Subscription } from "rxjs";
import { retryWhen, delay, take } from 'rxjs/operators';
-import { UserOperation, Community as CommunityI, Post, GetPostsForm, SortType, ListingType, GetPostsResponse, CreatePostLikeResponse, CommunityUser} from '../interfaces';
+import { UserOperation, Post, GetPostsForm, SortType, ListingType, GetPostsResponse, CreatePostLikeResponse, CommunityUser} from '../interfaces';
import { WebSocketService, UserService } from '../services';
import { PostListing } from './post-listing';
import { msgOp, fetchLimit } from '../utils';
@@ -12,7 +12,6 @@ interface PostListingsProps {
}
interface PostListingsState {
- community: CommunityI;
moderators: Array<CommunityUser>;
posts: Array<Post>;
sortType: SortType;
@@ -25,19 +24,6 @@ export class PostListings extends Component<PostListingsProps, PostListingsState
private subscription: Subscription;
private emptyState: PostListingsState = {
- community: {
- id: null,
- name: null,
- title: null,
- category_id: null,
- category_name: null,
- creator_id: null,
- creator_name: null,
- number_of_subscribers: null,
- number_of_posts: null,
- number_of_comments: null,
- published: null
- },
moderators: [],
posts: [],
sortType: SortType.Hot,
@@ -149,7 +135,7 @@ export class PostListings extends Component<PostListingsProps, PostListingsState
refetch() {
let getPostsForm: GetPostsForm = {
- community_id: this.state.community.id,
+ community_id: this.props.communityId,
page: this.state.page,
limit: fetchLimit,
sort: SortType[this.state.sortType],