SearchResponse,
GetSiteResponse,
GetCommunityResponse,
- ListCategoriesResponse,
- Category,
} from "lemmy-js-client";
import {
CommentSortType,
loading: boolean;
crossPosts: PostView[];
siteRes: GetSiteResponse;
- categories: Category[];
}
export class Post extends Component<any, PostState> {
loading: true,
crossPosts: [],
siteRes: this.isoData.site_res,
- categories: [],
};
constructor(props: any, context: any) {
this.state.postRes.comments,
this.state.commentSort
);
- this.state.categories = this.isoData.routeData[1].categories;
this.state.loading = false;
if (isBrowser()) {
}
} else {
this.fetchPost();
- WebSocketService.Instance.send(wsClient.listCategories());
}
}
setOptionalAuth(postForm, req.auth);
promises.push(req.client.getPost(postForm));
- promises.push(req.client.listCategories());
return promises;
}
online={this.state.postRes.online}
enableNsfw={this.state.siteRes.site_view.site.enable_nsfw}
showIcon
- categories={this.state.categories}
/>
</div>
);
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);
}
}
}