From 8dc4a3890dc5efcfda830f4496a5c86b0610e66e Mon Sep 17 00:00:00 2001 From: dimden Date: Tue, 31 Oct 2023 22:44:32 +0200 Subject: [PATCH] fix multiple posts appearing in search sometimes --- LICENSE | 1 + layouts/search/script.js | 1 + 2 files changed, 2 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..9dea9d1f --- /dev/null +++ b/LICENSE @@ -0,0 +1 @@ +All Rights Reserved \ No newline at end of file diff --git a/layouts/search/script.js b/layouts/search/script.js index 21a24043..27bb7c00 100644 --- a/layouts/search/script.js +++ b/layouts/search/script.js @@ -281,6 +281,7 @@ setInterval(async () => { if(data.length === 0) return; toRender = [...data, ...toRender]; + toRender = toRender.filter((t, i, self) => self.findIndex(t2 => t2.id_str === t.id_str) === i); newTweets.hidden = false; if(vars.updateTimelineAutomatically) { setTimeout(() => newTweets.click(), 10);