feed: render only notes from the past
some notes have a created at field that is 1 year in the future, these are always shown on to of the feed. changed to only render notes that are from the past.pull/63/head
parent
c2db08c7dc
commit
4a68940681
|
@ -324,7 +324,10 @@ const sortByCreatedAt = (evt1, evt2) => {
|
|||
};
|
||||
|
||||
function renderFeed() {
|
||||
const now = Math.floor(Date.now() * 0.001);
|
||||
const sortedFeeds = textNoteList
|
||||
// dont render notes from the future
|
||||
.filter(note => note.created_at < now)
|
||||
.filter(note => !fitlerDifficulty || note.tags.some(([tag, , commitment]) => tag === 'nonce' && commitment >= fitlerDifficulty))
|
||||
.sort(sortByCreatedAt).reverse();
|
||||
sortedFeeds.forEach((evt, i) => {
|
||||
|
|
Loading…
Reference in New Issue