Skip to content

Commit 08df559

Browse files
committed
fix lint err
1 parent 5e7115c commit 08df559

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

web_src/js/features/repo-issue-list.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,11 @@ async function initIssuePinSort() {
196196

197197
createSortable(pinDiv, {
198198
group: 'shared',
199-
onEnd: pinMoveEnd, // eslint-disable-line @typescript-eslint/no-misused-promises
199+
onEnd: (e) => {
200+
(async () => {
201+
await pinMoveEnd(e);
202+
})();
203+
},
200204
});
201205
}
202206

web_src/js/features/repo-settings-branches.ts

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,25 @@ export function initRepoBranchesSettings() {
99
createSortable(protectedBranchesList, {
1010
handle: '.drag-handle',
1111
animation: 150,
12-
onEnd: async () => { // eslint-disable-line @typescript-eslint/no-misused-promises
13-
const newOrder = Array.from(protectedBranchesList.children, (item) => {
14-
const id = item.getAttribute('data-id');
15-
return parseInt(id);
16-
}).filter((id) => !Number.isNaN(id));
1712

18-
try {
19-
await POST(protectedBranchesList.getAttribute('data-update-priority-url'), {
20-
data: {
21-
ids: newOrder,
22-
},
23-
});
24-
} catch (err) {
25-
const errorMessage = String(err);
26-
showErrorToast(`Failed to update branch protection rule priority:, error: ${errorMessage}`);
27-
}
13+
onEnd: () => {
14+
(async () => {
15+
const newOrder = Array.from(protectedBranchesList.children, (item) => {
16+
const id = item.getAttribute('data-id');
17+
return parseInt(id);
18+
}).filter((id) => !Number.isNaN(id));
19+
20+
try {
21+
await POST(protectedBranchesList.getAttribute('data-update-priority-url'), {
22+
data: {
23+
ids: newOrder,
24+
},
25+
});
26+
} catch (err) {
27+
const errorMessage = String(err);
28+
showErrorToast(`Failed to update branch protection rule priority:, error: ${errorMessage}`);
29+
}
30+
})();
2831
},
2932
});
3033
}

0 commit comments

Comments
 (0)