mirror of
https://github.com/discourse/discourse.git
synced 2026-08-08 20:18:23 -05:00
FIX: Recovering a post does not insert it back into the stream correctly.
This commit is contained in:
@@ -1096,13 +1096,13 @@ export default Ember.Controller.extend(BufferedContent, {
|
||||
}
|
||||
case "deleted": {
|
||||
postStream
|
||||
.triggerDeletedPost(data.id, data.post_number)
|
||||
.triggerDeletedPost(data.id)
|
||||
.then(() => refresh({ id: data.id }));
|
||||
break;
|
||||
}
|
||||
case "recovered": {
|
||||
postStream
|
||||
.triggerRecoveredPost(data.id, data.post_number)
|
||||
.triggerRecoveredPost(data.id)
|
||||
.then(() => refresh({ id: data.id }));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -565,8 +565,9 @@ export default RestModel.extend({
|
||||
return this.triggerChangedPost(postId, new Date());
|
||||
} else {
|
||||
// need to insert into stream
|
||||
const url = "/posts/" + postId;
|
||||
const url = `/posts/${postId}`;
|
||||
const store = this.store;
|
||||
|
||||
return ajax(url).then(p => {
|
||||
const post = store.createRecord("post", p);
|
||||
const stream = this.get("stream");
|
||||
@@ -591,7 +592,9 @@ export default RestModel.extend({
|
||||
});
|
||||
|
||||
if (index < posts.length) {
|
||||
posts.insertAt(index, post);
|
||||
this.get("postsWithPlaceholders").refreshAll(() => {
|
||||
posts.insertAt(index, post);
|
||||
});
|
||||
} else {
|
||||
if (post.post_number < posts[posts.length - 1].post_number + 5) {
|
||||
this.appendMore();
|
||||
|
||||
Reference in New Issue
Block a user