mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-23 19:31:33 +00:00
New nsfw posts.
This commit is contained in:
parent
eead117d6b
commit
3d649756ec
2 changed files with 13 additions and 4 deletions
14
ui/src/components/main.tsx
vendored
14
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;
|
||||||
|
|
||||||
|
// 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);
|
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) {
|
||||||
|
|
Loading…
Reference in a new issue