From 6cadde9ec90c01937f9a2405186a8764524298af Mon Sep 17 00:00:00 2001 From: VITALY-VORON <142410419+VITALY-VORON@users.noreply.github.com> Date: Thu, 24 Aug 2023 21:52:39 +0300 Subject: [PATCH] Update Tinder.js --- src/components/Tinder/Tinder.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/components/Tinder/Tinder.js b/src/components/Tinder/Tinder.js index cca2acb..068d80c 100644 --- a/src/components/Tinder/Tinder.js +++ b/src/components/Tinder/Tinder.js @@ -43,13 +43,20 @@ const db = [ console.log(name + ' left the screen!'); }; - let uniqueTags = []; - const getId = () => { - uniqueTags = cardId.filter(function(elem, pos) { - return cardId.indexOf(elem) === pos; - }); - console.log(uniqueTags); - } + useEffect(() => { + let uniqueTags = []; + if (cardId.length === swiped.id) { + uniqueTags = cardId.filter(function(elem, pos) { + return cardId.indexOf(elem) === pos;}) + console.log(uniqueTags); + } + }) + // const getId = () => { + // uniqueTags = cardId.filter(function(elem, pos) { + // return cardId.indexOf(elem) === pos; + // }); + // console.log(uniqueTags); + // } return (