]> Untitled Git - lemmy-ui.git/blobdiff - src/shared/components/post.tsx
Remove categories
[lemmy-ui.git] / src / shared / components / post.tsx
index 610249915d5ed5d70c9eb40b98ee7fa2dafed1bb..b1bd9aaa52608b709621b5859f63361ae3db8d2d 100644 (file)
@@ -21,8 +21,6 @@ import {
   SearchResponse,
   GetSiteResponse,
   GetCommunityResponse,
-  ListCategoriesResponse,
-  Category,
 } from "lemmy-js-client";
 import {
   CommentSortType,
@@ -74,7 +72,6 @@ interface PostState {
   loading: boolean;
   crossPosts: PostView[];
   siteRes: GetSiteResponse;
-  categories: Category[];
 }
 
 export class Post extends Component<any, PostState> {
@@ -91,7 +88,6 @@ export class Post extends Component<any, PostState> {
     loading: true,
     crossPosts: [],
     siteRes: this.isoData.site_res,
-    categories: [],
   };
 
   constructor(props: any, context: any) {
@@ -109,7 +105,6 @@ export class Post extends Component<any, PostState> {
         this.state.postRes.comments,
         this.state.commentSort
       );
-      this.state.categories = this.isoData.routeData[1].categories;
       this.state.loading = false;
 
       if (isBrowser()) {
@@ -120,7 +115,6 @@ export class Post extends Component<any, PostState> {
       }
     } else {
       this.fetchPost();
-      WebSocketService.Instance.send(wsClient.listCategories());
     }
   }
 
@@ -158,7 +152,6 @@ export class Post extends Component<any, PostState> {
     setOptionalAuth(postForm, req.auth);
 
     promises.push(req.client.getPost(postForm));
-    promises.push(req.client.listCategories());
 
     return promises;
   }
@@ -402,7 +395,6 @@ export class Post extends Component<any, PostState> {
           online={this.state.postRes.online}
           enableNsfw={this.state.siteRes.site_view.site.enable_nsfw}
           showIcon
-          categories={this.state.categories}
         />
       </div>
     );
@@ -570,10 +562,6 @@ export class Post extends Component<any, PostState> {
       this.state.postRes.post_view.community = data.community_view.community;
       this.state.postRes.moderators = data.moderators;
       this.setState(this.state);
-    } else if (op == UserOperation.ListCategories) {
-      let data = wsJsonToRes<ListCategoriesResponse>(msg).data;
-      this.state.categories = data.categories;
-      this.setState(this.state);
     }
   }
 }