chore(project): satisfy eslint unicorn rules in board SSE handlers
This commit is contained in:
@@ -286,7 +286,7 @@ function handleCardMoved(board: HTMLElement, payload: CardMovedPayload): void {
|
||||
const target = board.querySelector<HTMLElement>(`#board_${payload.to_column_id}`);
|
||||
if (!target) return;
|
||||
const fromColumn = card.parentElement;
|
||||
target.appendChild(card);
|
||||
target.append(card);
|
||||
if (fromColumn instanceof HTMLElement) {
|
||||
const fromColumnEl = fromColumn.closest<HTMLElement>('.project-column');
|
||||
if (fromColumnEl) updateColumnCount(fromColumnEl);
|
||||
@@ -364,10 +364,10 @@ function handleColumnReordered(board: HTMLElement, payload: ColumnReorderedPaylo
|
||||
// each column element in that order. appendChild on an existing
|
||||
// node moves it rather than cloning, so the result is an in-place
|
||||
// reorder.
|
||||
const order = [...payload.columns].sort((a, b) => a.sorting - b.sorting);
|
||||
const order = Array.from(payload.columns).sort((a, b) => a.sorting - b.sorting);
|
||||
for (const entry of order) {
|
||||
const el = board.querySelector<HTMLElement>(`.project-column[data-id="${entry.column_id}"]`);
|
||||
if (el) board.appendChild(el);
|
||||
if (el) board.append(el);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user