Skip to content

Commit e6a82ee

Browse files
committed
Fixed linting
1 parent 8989520 commit e6a82ee

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

web_src/js/features/repo-commit.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,24 @@ export function initCommitStatuses() {
2626
});
2727
}
2828

29-
window.addEventListener("DOMContentLoaded", function () {
30-
console.log("hello");
31-
$("input[name=history-enable-follow-renames]").prop("checked", location.toString().includes("history_follow_rename=true"))
32-
})
29+
window.addEventListener('DOMContentLoaded', () => {
30+
($('input[name=history-enable-follow-renames]')[0] as HTMLInputElement).checked = location.toString().includes('history_follow_rename=true');
31+
});
3332

34-
$("input[name=history-enable-follow-renames]").on("change", function() {
35-
const checked = $(this).is(":checked");
33+
$('input[name=history-enable-follow-renames]').on('change', function() {
34+
const checked = ($(this)[0] as HTMLInputElement).matches(':checked');
3635
let url = location.toString();
3736

38-
url = url.replaceAll(/history_follow_rename=(true|false)&*/g, "");
39-
if (url.slice(-1) === '?') {
40-
url = url.slice(0, url.length - 1);
37+
url = url.replaceAll(/history_follow_rename=(true|false)&*/g, '');
38+
if (url.endsWith('?')) {
39+
url = url.slice(0, -1);
4140
}
42-
if (url.includes("?")) {
43-
url += "&";
41+
if (url.includes('?')) {
42+
url += '&';
4443
} else {
45-
url += "?";
44+
url += '?';
4645
}
4746

4847
url += `history_follow_rename=${checked}`;
4948
window.location.href = url;
50-
})
49+
});

0 commit comments

Comments
 (0)