Have setting to disable notifs for new posts. Fixes #132 (#345)

This commit is contained in:
Dessalines 2021-07-22 16:18:13 -04:00 committed by GitHub
parent e9896eb469
commit 1fd6bbc937
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 52 additions and 9 deletions

View file

@ -849,17 +849,31 @@ export class Home extends Component<any, HomeState> {
.includes(data.post_view.community.id)
) {
this.state.posts.unshift(data.post_view);
notifyPost(data.post_view, this.context.router);
if (
UserService.Instance.localUserView?.local_user
.show_new_post_notifs
) {
notifyPost(data.post_view, this.context.router);
}
}
} else if (this.state.listingType == ListingType.Local) {
// If you're on the local view, only push it if its local
if (data.post_view.post.local) {
this.state.posts.unshift(data.post_view);
notifyPost(data.post_view, this.context.router);
if (
UserService.Instance.localUserView?.local_user
.show_new_post_notifs
) {
notifyPost(data.post_view, this.context.router);
}
}
} else {
this.state.posts.unshift(data.post_view);
notifyPost(data.post_view, this.context.router);
if (
UserService.Instance.localUserView?.local_user.show_new_post_notifs
) {
notifyPost(data.post_view, this.context.router);
}
}
this.setState(this.state);
}