aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features/pull-view-file.ts
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2024-12-15 22:02:32 +0100
committerGitHub <noreply@github.com>2024-12-16 05:02:32 +0800
commitc8ea41b049c887794e4dd87b690b3031b98458b9 (patch)
tree2e3fbfdeced634ff8079b19b9f9ecf769a714c76 /web_src/js/features/pull-view-file.ts
parent74b06d4f5cc8dd11140a778768d384c4240ecd66 (diff)
downloadgitea-c8ea41b049c887794e4dd87b690b3031b98458b9.tar.gz
gitea-c8ea41b049c887794e4dd87b690b3031b98458b9.zip
Fix remaining typescript issues, enable `tsc` (#32840)
Fixes 79 typescript errors. Discovered at least two bugs in `notifications.ts`, and I'm pretty sure this feature was at least partially broken and may still be, I don't really know how to test it. After this, only like ~10 typescript errors remain in the codebase but those are harder to solve. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'web_src/js/features/pull-view-file.ts')
-rw-r--r--web_src/js/features/pull-view-file.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/web_src/js/features/pull-view-file.ts b/web_src/js/features/pull-view-file.ts
index 9a052207d5..36fe4bc4df 100644
--- a/web_src/js/features/pull-view-file.ts
+++ b/web_src/js/features/pull-view-file.ts
@@ -34,7 +34,7 @@ export function countAndUpdateViewedFiles() {
export function initViewedCheckboxListenerFor() {
for (const form of document.querySelectorAll(`${viewedCheckboxSelector}:not([data-has-viewed-checkbox-listener="true"])`)) {
// To prevent double addition of listeners
- form.setAttribute('data-has-viewed-checkbox-listener', true);
+ form.setAttribute('data-has-viewed-checkbox-listener', String(true));
// The checkbox consists of a div containing the real checkbox with its label and the CSRF token,
// hence the actual checkbox first has to be found
@@ -67,7 +67,7 @@ export function initViewedCheckboxListenerFor() {
// Unfortunately, actual forms cause too many problems, hence another approach is needed
const files = {};
files[fileName] = this.checked;
- const data = {files};
+ const data: Record<string, any> = {files};
const headCommitSHA = form.getAttribute('data-headcommit');
if (headCommitSHA) data.headCommitSHA = headCommitSHA;
POST(form.getAttribute('data-link'), {data});