From 2ae9c619c7fb292223eda2611c2a532b8af0808d Mon Sep 17 00:00:00 2001 From: AlexSserb Date: Mon, 4 Aug 2025 00:13:40 +0400 Subject: [PATCH] fix: fixed dragging of deal in the same status --- src/app/deals/components/Boards/Boards.tsx | 1 - src/app/deals/hooks/useGetNewRank.ts | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/app/deals/components/Boards/Boards.tsx b/src/app/deals/components/Boards/Boards.tsx index bd7e954..5730073 100644 --- a/src/app/deals/components/Boards/Boards.tsx +++ b/src/app/deals/components/Boards/Boards.tsx @@ -19,7 +19,6 @@ const Boards = () => { }; const selectBoard = (board: BoardSchema) => { - console.log("Board selecting:", board); setSelectedBoard(board); }; diff --git a/src/app/deals/hooks/useGetNewRank.ts b/src/app/deals/hooks/useGetNewRank.ts index d530b8d..8b3b0e2 100644 --- a/src/app/deals/hooks/useGetNewRank.ts +++ b/src/app/deals/hooks/useGetNewRank.ts @@ -4,7 +4,7 @@ import { DealSchema } from "@/client"; import { getNewLexorank, sortByLexorank } from "@/utils/lexorank"; const useGetNewRank = () => { - const { deals, statuses } = useStatusesContext(); + const { statuses } = useStatusesContext(); const getNewRankForSameStatus = ( statusDeals: DealSchema[], @@ -20,10 +20,12 @@ const useGetNewRank = () => { : [overDealIndex, overDealIndex + 1]; const leftLexorank = - leftIndex >= 0 ? LexoRank.parse(deals[leftIndex].lexorank) : null; + leftIndex >= 0 + ? LexoRank.parse(statusDeals[leftIndex].lexorank) + : null; const rightLexorank = - rightIndex < deals.length - ? LexoRank.parse(deals[rightIndex].lexorank) + rightIndex < statusDeals.length + ? LexoRank.parse(statusDeals[rightIndex].lexorank) : null; return getNewLexorank(leftLexorank, rightLexorank).toString();