GetCommentsResponse,
CommentResponse,
GetSiteResponse,
- Category,
- ListCategoriesResponse,
} from "lemmy-js-client";
import { UserService, WebSocketService } from "../services";
import { PostListings } from "./post-listings";
dataType: DataType;
sort: SortType;
page: number;
- categories: Category[];
}
interface CommunityProps {
sort: getSortTypeFromProps(this.props),
page: getPageFromProps(this.props),
siteRes: this.isoData.site_res,
- categories: [],
};
constructor(props: any, context: any) {
} else {
this.state.comments = this.isoData.routeData[1].comments;
}
- this.state.categories = this.isoData.routeData[2].categories;
this.state.communityLoading = false;
this.state.postsLoading = false;
this.state.commentsLoading = false;
} else {
this.fetchCommunity();
this.fetchData();
- WebSocketService.Instance.send(wsClient.listCategories());
}
setupTippy();
}
promises.push(req.client.getComments(getCommentsForm));
}
- promises.push(req.client.listCategories());
-
return promises;
}
admins={this.state.siteRes.admins}
online={this.state.communityRes.online}
enableNsfw={this.state.siteRes.site_view.site.enable_nsfw}
- categories={this.state.categories}
/>
</div>
</div>
let data = wsJsonToRes<CommentResponse>(msg).data;
createCommentLikeRes(data.comment_view, this.state.comments);
this.setState(this.state);
- } else if (op == UserOperation.ListCategories) {
- let data = wsJsonToRes<ListCategoriesResponse>(msg).data;
- this.state.categories = data.categories;
- this.setState(this.state);
}
}
}