mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
0
fork

Configure Feed

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

Bump replies (#2604)

* fix: bump replies

* refactor: only bump if not at 0

authored by

Mary and committed by
GitHub
2754121f 6ad58635

+14 -3
+14 -3
src/lib/api/feed-manip.ts
··· 168 168 169 169 const selfReplyUri = getSelfReplyUri(item) 170 170 if (selfReplyUri) { 171 - const parent = slices.find(item2 => 172 - item2.isNextInThread(selfReplyUri), 171 + const index = slices.findIndex(slice => 172 + slice.isNextInThread(selfReplyUri), 173 173 ) 174 - if (parent) { 174 + 175 + if (index !== -1) { 176 + const parent = slices[index] 177 + 175 178 parent.insert(item) 179 + 180 + // If our slice isn't currently on the top, reinsert it to the top. 181 + if (index !== 0) { 182 + slices.splice(index, 1) 183 + slices.unshift(parent) 184 + } 185 + 176 186 continue 177 187 } 178 188 } 189 + 179 190 slices.unshift(new FeedViewPostsSlice([item])) 180 191 } 181 192 }