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:
parent
3614fad595
commit
f0658d3ec4
1 changed files with 2 additions and 4 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue