From cf33c035f5e47c508dc707da03faf7aed5b80c46 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Wed, 8 May 2024 11:45:37 +0200 Subject: [PATCH] offer need issue fixed --- src/Components/Profile/OverlayItemProfileSettings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Profile/OverlayItemProfileSettings.tsx b/src/Components/Profile/OverlayItemProfileSettings.tsx index 4fb982f6..8b2a40e4 100644 --- a/src/Components/Profile/OverlayItemProfileSettings.tsx +++ b/src/Components/Profile/OverlayItemProfileSettings.tsx @@ -135,7 +135,7 @@ export function OverlayItemProfileSettings() { let needs_updates: Array = []; needs?.map(n => { - const existingNeed = user?.needs.find(t => t.tags_id === n.id) + const existingNeed = item?.needs?.find(t => t.tags_id === n.id) existingNeed && needs_updates.push(existingNeed.id) !existingNeed && needs_updates.push({ items_id: item?.id, tags_id: n.id }) !existingNeed && !tags.some(t => t.id === n.id) && addTag({ ...n, offer_or_need: true })