mirror of
https://github.com/flarum/framework.git
synced 2025-05-22 22:59:57 +08:00
API for syncing added/removed posts after a discussion is updated
This commit is contained in:
@ -78,8 +78,8 @@ class Discussion extends Model {
|
||||
var title = prompt('Enter a new title for this discussion:', currentTitle);
|
||||
if (title && title !== currentTitle) {
|
||||
this.save({title}).then(discussion => {
|
||||
if (app.current.discussion && app.current.discussion().id() === discussion.id()) {
|
||||
discussion.addedPosts().forEach(post => app.current.stream().addPostToEnd(post));
|
||||
if (app.current instanceof DiscussionPage) {
|
||||
app.current.stream().sync();
|
||||
}
|
||||
m.redraw();
|
||||
});
|
||||
|
Reference in New Issue
Block a user