SearchType,
SearchResponse,
WebSocketJsonResponse,
-} from '../interfaces';
+} from 'lemmy-js-client';
import { WebSocketService, UserService } from '../services';
import {
wsJsonToRes,
nsfw: false,
auth: null,
community_id: null,
- creator_id: UserService.Instance.user
- ? UserService.Instance.user.id
- : null,
},
communities: [],
loading: false,
name: this.props.post.name,
community_id: this.props.post.community_id,
edit_id: this.props.post.id,
- creator_id: this.props.post.creator_id,
url: this.props.post.url,
nsfw: this.props.post.nsfw,
auth: null,
);
let listCommunitiesForm: ListCommunitiesForm = {
- sort: SortType[SortType.TopAll],
+ sort: SortType.TopAll,
limit: 9999,
};
componentWillUnmount() {
this.subscription.unsubscribe();
- this.choices && this.choices.destroy();
+ /* this.choices && this.choices.destroy(); */
window.onbeforeunload = null;
}
if (validURL(this.state.postForm.url)) {
let form: SearchForm = {
q: this.state.postForm.url,
- type_: SearchType[SearchType.Url],
- sort: SortType[SortType.TopAll],
+ type_: SearchType.Url,
+ sort: SortType.TopAll,
page: 1,
limit: 6,
};
fetchSimilarPosts() {
let form: SearchForm = {
q: this.state.postForm.name,
- type_: SearchType[SearchType.Posts],
- sort: SortType[SortType.TopAll],
+ type_: SearchType.Posts,
+ sort: SortType.TopAll,
community_id: this.state.postForm.community_id,
page: 1,
limit: 6,