MCPcopy Create free account
hub / github.com/EsperoTech/yaade / drop

Function drop

client/src/components/collectionView/MoveableRequest.tsx:143–166  ·  view source on GitHub ↗
(item: RequestDragItem)

Source from the content-addressed store, hash-verified

141 };
142 },
143 drop(item: RequestDragItem) {
144 let newRank: number;
145 if (isTopHovered) {
146 newRank = calculateTopHoveredRank(
147 index,
148 item.index,
149 request.collectionId,
150 item.collectionId,
151 );
152 } else if (isBottomHovered) {
153 newRank = calculateBottomHoveredRank(
154 index,
155 item.index,
156 request.collectionId,
157 item.collectionId,
158 );
159 } else {
160 return;
161 }
162 if (item.index === newRank && item.collectionId === request.collectionId) {
163 return;
164 }
165 moveRequest(item.id, newRank, request.collectionId);
166 },
167 });
168
169 const [{ isDragging }, drag] = useDrag({

Callers 1

MoveableRequestFunction · 0.70

Calls 3

calculateTopHoveredRankFunction · 0.70
moveRequestFunction · 0.50

Tested by

no test coverage detected