fix: fixed dragging of deal in the same status
This commit is contained in:
@ -19,7 +19,6 @@ const Boards = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const selectBoard = (board: BoardSchema) => {
|
const selectBoard = (board: BoardSchema) => {
|
||||||
console.log("Board selecting:", board);
|
|
||||||
setSelectedBoard(board);
|
setSelectedBoard(board);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { DealSchema } from "@/client";
|
|||||||
import { getNewLexorank, sortByLexorank } from "@/utils/lexorank";
|
import { getNewLexorank, sortByLexorank } from "@/utils/lexorank";
|
||||||
|
|
||||||
const useGetNewRank = () => {
|
const useGetNewRank = () => {
|
||||||
const { deals, statuses } = useStatusesContext();
|
const { statuses } = useStatusesContext();
|
||||||
|
|
||||||
const getNewRankForSameStatus = (
|
const getNewRankForSameStatus = (
|
||||||
statusDeals: DealSchema[],
|
statusDeals: DealSchema[],
|
||||||
@ -20,10 +20,12 @@ const useGetNewRank = () => {
|
|||||||
: [overDealIndex, overDealIndex + 1];
|
: [overDealIndex, overDealIndex + 1];
|
||||||
|
|
||||||
const leftLexorank =
|
const leftLexorank =
|
||||||
leftIndex >= 0 ? LexoRank.parse(deals[leftIndex].lexorank) : null;
|
leftIndex >= 0
|
||||||
|
? LexoRank.parse(statusDeals[leftIndex].lexorank)
|
||||||
|
: null;
|
||||||
const rightLexorank =
|
const rightLexorank =
|
||||||
rightIndex < deals.length
|
rightIndex < statusDeals.length
|
||||||
? LexoRank.parse(deals[rightIndex].lexorank)
|
? LexoRank.parse(statusDeals[rightIndex].lexorank)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
return getNewLexorank(leftLexorank, rightLexorank).toString();
|
return getNewLexorank(leftLexorank, rightLexorank).toString();
|
||||||
|
|||||||
Reference in New Issue
Block a user