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.
OFF0 2 years ago
parent c2db08c7dc
commit 4a68940681
Signed by: offbyn
GPG Key ID: 94A2F643C51F37FA

@ -324,7 +324,10 @@ const sortByCreatedAt = (evt1, evt2) => {
}; };
function renderFeed() { function renderFeed() {
const now = Math.floor(Date.now() * 0.001);
const sortedFeeds = textNoteList 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)) .filter(note => !fitlerDifficulty || note.tags.some(([tag, , commitment]) => tag === 'nonce' && commitment >= fitlerDifficulty))
.sort(sortByCreatedAt).reverse(); .sort(sortByCreatedAt).reverse();
sortedFeeds.forEach((evt, i) => { sortedFeeds.forEach((evt, i) => {

Loading…
Cancel
Save