Skip to content

Commit

Permalink
post#sectionsContainedBy returns [] when head section === tail section
Browse files Browse the repository at this point in the history
Fix #134
  • Loading branch information
bantic committed Sep 15, 2015
1 parent db4c922 commit 0a9fc7b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/js/models/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,12 @@ export default class Post {
}
};

let headTopLevelSection = findParent(head.section, s => !!s.post);
let tailTopLevelSection = findParent(tail.section, s => !!s.post);
const headTopLevelSection = findParent(head.section, s => !!s.post);
const tailTopLevelSection = findParent(tail.section, s => !!s.post);

if (headTopLevelSection === tailTopLevelSection) {
return containedSections;
}

let currentSection = headTopLevelSection.next;
while (currentSection && currentSection !== tailTopLevelSection) {
Expand Down

0 comments on commit 0a9fc7b

Please sign in to comment.