From 2ece5b44aca98767d2f5c147e44d16fe4e268b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Sat, 6 May 2023 01:16:17 +0200 Subject: [PATCH] added duplicatas removal and reverse order --- front/views/HomeView.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/front/views/HomeView.tsx b/front/views/HomeView.tsx index 358f49c..35a2d2e 100644 --- a/front/views/HomeView.tsx +++ b/front/views/HomeView.tsx @@ -135,7 +135,7 @@ const HomeView = () => { searchHistoryQuery.data?.length === 0 && } { - searchHistoryQuery.data?.slice(0, 5).map((search) => ( + [...(new Set(searchHistoryQuery.data.map((x) => x.query)))].reverse().slice(0, 5).map((query) => ( )) }