New nsfw posts.
This commit is contained in:
parent
fab10ef792
commit
b277d92226
2 changed files with 13 additions and 4 deletions
16
ui/src/components/main.tsx
vendored
16
ui/src/components/main.tsx
vendored
|
@ -626,10 +626,20 @@ export class Main extends Component<any, MainState> {
|
||||||
this.state.posts.unshift(data.post);
|
this.state.posts.unshift(data.post);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.state.posts.unshift(data.post);
|
// NSFW posts
|
||||||
}
|
let nsfw = data.post.nsfw || data.post.community_nsfw;
|
||||||
|
|
||||||
this.setState(this.state);
|
// Don't push the post if its nsfw, and don't have that setting on
|
||||||
|
if (
|
||||||
|
!nsfw ||
|
||||||
|
(nsfw &&
|
||||||
|
UserService.Instance.user &&
|
||||||
|
UserService.Instance.user.show_nsfw)
|
||||||
|
) {
|
||||||
|
this.state.posts.unshift(data.post);
|
||||||
|
this.setState(this.state);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (res.op == UserOperation.EditPost) {
|
} else if (res.op == UserOperation.EditPost) {
|
||||||
let data = res.data as PostResponse;
|
let data = res.data as PostResponse;
|
||||||
editPostFindRes(data, this.state.posts);
|
editPostFindRes(data, this.state.posts);
|
||||||
|
|
1
ui/src/components/post-listing.tsx
vendored
1
ui/src/components/post-listing.tsx
vendored
|
@ -846,7 +846,6 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
} else {
|
} else {
|
||||||
this.state.thumbnail = null;
|
this.state.thumbnail = null;
|
||||||
}
|
}
|
||||||
this.setState(this.state);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handlePostLike(i: PostListing) {
|
handlePostLike(i: PostListing) {
|
||||||
|
|
Reference in a new issue