mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-23 11:21:32 +00:00
New nsfw posts.
This commit is contained in:
parent
eead117d6b
commit
3d649756ec
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);
|
||||
}
|
||||
} 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) {
|
||||
let data = res.data as PostResponse;
|
||||
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 {
|
||||
this.state.thumbnail = null;
|
||||
}
|
||||
this.setState(this.state);
|
||||
}
|
||||
|
||||
handlePostLike(i: PostListing) {
|
||||
|
|
Loading…
Reference in a new issue