FIX: If last post was deleted the gap was not displayed

This commit is contained in:
Robin Ward 2016-02-09 15:53:34 -05:00
parent 2998fe1ee5
commit 9ec44f755c
3 changed files with 3 additions and 1 deletions

View File

@ -28,6 +28,7 @@ export default MountWidget.extend({
return this.getProperties('posts', return this.getProperties('posts',
'canCreatePost', 'canCreatePost',
'multiSelect', 'multiSelect',
'gaps',
'selectedQuery', 'selectedQuery',
'selectedPostsCount', 'selectedPostsCount',
'searchService'); 'searchService');

View File

@ -280,6 +280,7 @@ export default RestModel.extend({
if (idx !== -1) { if (idx !== -1) {
stream.pushObjects(gap); stream.pushObjects(gap);
return this.appendMore().then(() => { return this.appendMore().then(() => {
delete this.get('gaps.after')[postId];
this.get('stream').enumerableContentDidChange(); this.get('stream').enumerableContentDidChange();
}); });
} }

View File

@ -15,7 +15,7 @@ export default createWidget('post-stream', {
const result = []; const result = [];
const before = attrs.gaps && attrs.gaps.before ? attrs.gaps.before : {}; const before = attrs.gaps && attrs.gaps.before ? attrs.gaps.before : {};
const after = attrs.gaps && attrs.gaps.before ? attrs.gaps.after : {}; const after = attrs.gaps && attrs.gaps.after ? attrs.gaps.after : {};
let prevPost; let prevPost;
let prevDate; let prevDate;