From 4a6894068157c58582cb6ba050fc748f393aa94f Mon Sep 17 00:00:00 2001 From: OFF0 Date: Tue, 17 Jan 2023 08:57:36 +0100 Subject: [PATCH] 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. --- src/main.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.js b/src/main.js index dc85c1e..cf7a66e 100644 --- a/src/main.js +++ b/src/main.js @@ -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) => {