FIX: `postChangedRoute` was firing after destruction sometimes
This commit is contained in:
parent
bad9835120
commit
81a0b25324
|
@ -122,7 +122,9 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, {
|
|||
const postStream = this.get('model.postStream');
|
||||
const firstLoadedPost = postStream.get('posts.firstObject');
|
||||
|
||||
this.set('model.currentPost', post.get('post_number'));
|
||||
const currentPostNumber = post.get('post_number');
|
||||
this.set('model.currentPost', currentPostNumber);
|
||||
this.send('postChangedRoute', currentPostNumber);
|
||||
|
||||
if (post.get('post_number') === 1) { return; }
|
||||
|
||||
|
@ -712,14 +714,6 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, {
|
|||
}
|
||||
},
|
||||
|
||||
// If our current post is changed, notify the router
|
||||
_currentPostChanged: function() {
|
||||
const currentPost = this.get('model.currentPost');
|
||||
if (currentPost) {
|
||||
this.send('postChangedRoute', currentPost);
|
||||
}
|
||||
}.observes('model.currentPost'),
|
||||
|
||||
readPosts(topicId, postNumbers) {
|
||||
const topic = this.get("model"),
|
||||
postStream = topic.get("postStream");
|
||||
|
|
Loading…
Reference in New Issue