Skip to content

Commit 32bab00

Browse files
committed
fix more in repo-issue.ts
1 parent ac5c054 commit 32bab00

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

web_src/js/features/repo-issue.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export function initRepoIssueCommentDelete() {
143143
const counter = document.querySelector('#review-box .review-comments-counter');
144144
let num = parseInt(counter?.getAttribute('data-pending-comment-number')) - 1 || 0;
145145
num = Math.max(num, 0);
146-
counter.setAttribute('data-pending-comment-number', num);
146+
counter.setAttribute('data-pending-comment-number', String(num));
147147
counter.textContent = String(num);
148148
}
149149

@@ -268,12 +268,14 @@ export function initRepoPullRequestMergeInstruction() {
268268
export function initRepoPullRequestAllowMaintainerEdit() {
269269
const wrapper = document.querySelector('#allow-edits-from-maintainers');
270270
if (!wrapper) return;
271-
const checkbox = wrapper.querySelector('input[type="checkbox"]');
271+
const checkbox = wrapper.querySelector<HTMLInputElement>('input[type="checkbox"]');
272272
checkbox.addEventListener('input', async () => {
273273
const url = `${wrapper.getAttribute('data-url')}/set_allow_maintainer_edit`;
274274
wrapper.classList.add('is-loading');
275275
try {
276-
const resp = await POST(url, {data: new URLSearchParams({allow_maintainer_edit: checkbox.checked})});
276+
const resp = await POST(url, {data: new URLSearchParams({
277+
allow_maintainer_edit: String(checkbox.checked),
278+
})});
277279
if (!resp.ok) {
278280
throw new Error('Failed to update maintainer edit permission');
279281
}
@@ -322,7 +324,7 @@ export function initRepoIssueWipTitle() {
322324

323325
const $issueTitle = $('#issue_title');
324326
$issueTitle.trigger('focus');
325-
const value = $issueTitle.val().trim().toUpperCase();
327+
const value = ($issueTitle.val() as string).trim().toUpperCase();
326328

327329
const wipPrefixes = $('.title_wip_desc').data('wip-prefixes');
328330
for (const prefix of wipPrefixes) {

0 commit comments

Comments
 (0)