this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Prevent pinned posts from being grouped

+16
+16
src/components/timeline.jsx
··· 65 65 try { 66 66 let { done, value } = await fetchItems(firstLoad); 67 67 if (Array.isArray(value)) { 68 + // Avoid grouping for pinned posts 69 + const [pinnedPosts, otherPosts] = value.reduce( 70 + (acc, item) => { 71 + if (item._pinned) { 72 + acc[0].push(item); 73 + } else { 74 + acc[1].push(item); 75 + } 76 + return acc; 77 + }, 78 + [[], []], 79 + ); 80 + value = otherPosts; 68 81 if (allowGrouping) { 69 82 if (boostsCarousel) { 70 83 value = groupBoosts(value); 71 84 } 72 85 value = groupContext(value); 86 + } 87 + if (pinnedPosts.length) { 88 + value = pinnedPosts.concat(value); 73 89 } 74 90 console.log(value); 75 91 if (firstLoad) {