mirror of
https://github.com/styppo/hamstr.git
synced 2024-10-18 05:23:28 +00:00
Deduplicate initial feed items, #7
This commit is contained in:
parent
68d0333e3a
commit
7514a48e63
@ -88,7 +88,9 @@ export default {
|
||||
.concat(data)
|
||||
.filter(note => this.filterNote(note, this.feed.hideBots))
|
||||
.map(note => [note]) // TODO Single element thread
|
||||
items.sort(feedOrder)
|
||||
.sort(feedOrder)
|
||||
.filter((item, pos, array) => !pos || item[0].id !== array[pos - 1][0].id)
|
||||
|
||||
this.visible = items.slice(0, MAX_ITEMS_VISIBLE)
|
||||
this.loading = false
|
||||
|
||||
@ -111,6 +113,7 @@ export default {
|
||||
// TODO Deduplicate feed items
|
||||
this.newer.sort(feedOrder)
|
||||
const items = this.newer.concat(this.visible)
|
||||
|
||||
if (items.length > MAX_ITEMS_VISIBLE) {
|
||||
const older = items.splice(MAX_ITEMS_VISIBLE)
|
||||
this.older = older.concat(this.older)
|
||||
|
Loading…
Reference in New Issue
Block a user