mirror of
https://github.com/discourse/discourse.git
synced 2025-03-03 20:17:41 +08:00
Only scroll to posts that are not your own in PMs.
This commit is contained in:
parent
7a1400cc4b
commit
4a26561927
@ -841,16 +841,20 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, {
|
||||
this.send('postChangedRoute', topic.get('post_number') || 1);
|
||||
});
|
||||
} else {
|
||||
const postNumber = data.post_number;
|
||||
const notInPostStream = topic.get('highest_post_number') <= postNumber;
|
||||
const postNumberDifference = postNumber - topic.get('currentPost');
|
||||
if (topic.get('isPrivateMessage') &&
|
||||
this.currentUser &&
|
||||
this.currentUser.get('id') !== data.user_id) {
|
||||
|
||||
if (notInPostStream &&
|
||||
topic.get('isPrivateMessage') &&
|
||||
const postNumber = data.post_number;
|
||||
const notInPostStream = topic.get('highest_post_number') <= postNumber;
|
||||
const postNumberDifference = postNumber - topic.get('currentPost');
|
||||
|
||||
if (notInPostStream &&
|
||||
postNumberDifference > 0 &&
|
||||
postNumberDifference < 7) {
|
||||
|
||||
this._scrollToPost(data.post_number);
|
||||
this._scrollToPost(data.post_number);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user