From d035d18aa08deceea61541031ca998e8eb0d200d Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 30 Jun 2023 09:48:52 +0800 Subject: [PATCH] Fix duplicated search results Also fix other stuff --- src/pages/search.jsx | 47 ++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/src/pages/search.jsx b/src/pages/search.jsx index 24b52faa..bb507f1a 100644 --- a/src/pages/search.jsx +++ b/src/pages/search.jsx @@ -87,7 +87,7 @@ function Search(props) { try { const results = await masto.v2.search(params); console.log(results); - if (type) { + if (type && !firstLoad) { if (type === 'statuses') { setStatusResults((prev) => [...prev, ...results.statuses]); } else if (type === 'accounts') { @@ -174,7 +174,7 @@ function Search(props) { <>