FEATURE: only scroll to bottom for discobot

Non discobot replies on PMs triggering scroll cause confusion.
This commit is contained in:
Sam Saffron 2019-05-06 10:55:58 +10:00
parent d4bf7d6831
commit 267d129f38
1 changed files with 4 additions and 0 deletions

View File

@ -1272,10 +1272,14 @@ export default Ember.Controller.extend(bufferedProperty("model"), {
}
}
// scroll to bottom is very specific to new posts from discobot
// hence the -2 check (dicobot id). We can shift all this code
// to discobot plugin longer term
if (
topic.get("isPrivateMessage") &&
this.currentUser &&
this.currentUser.get("id") !== data.user_id &&
data.user_id === -2 &&
data.type === "created"
) {
const postNumber = data.post_number;