fix: fixed dragging of deal in the same status

This commit is contained in:
2025-08-04 00:13:40 +04:00
parent 315e7db3db
commit 2ae9c619c7
2 changed files with 6 additions and 5 deletions

View File

@ -19,7 +19,6 @@ const Boards = () => {
};
const selectBoard = (board: BoardSchema) => {
console.log("Board selecting:", board);
setSelectedBoard(board);
};

View File

@ -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();