0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-28 13:12:45 +01:00

address TS review

This commit is contained in:
m.huber 2024-11-11 17:28:06 +01:00
parent 3614fad595
commit f0658d3ec4

View file

@ -2,9 +2,7 @@ import {createSortable} from '../modules/sortable.ts';
import {POST} from '../modules/fetch.ts';
export function initRepoBranchesSettings() {
const protectedBranchesList = document.querySelector(
'#protected-branches-list',
);
const protectedBranchesList = document.querySelector('#protected-branches-list');
if (!protectedBranchesList) return;
createSortable(protectedBranchesList, {
@ -13,7 +11,7 @@ export function initRepoBranchesSettings() {
onEnd: async () => { // eslint-disable-line @typescript-eslint/no-misused-promises
const newOrder = Array.from(protectedBranchesList.children, (item) => {
const id = item.getAttribute('data-id');
return id ? parseInt(id) : NaN;
return parseInt(id);
}).filter((id) => !Number.isNaN(id));
try {