Skip to content

Commit 297f63a

Browse files
GiteaBotlunny
andauthored
Remove wrong code (#35846) (#35856)
Backport #35846 by @lunny Follow #35821 Fix #35844 (comment) The reviewed file numbers and progress have been set from backend so that we don't need to update the numbers when clicking `load more`. Co-authored-by: Lunny Xiao <[email protected]>
1 parent 6a55749 commit 297f63a

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

web_src/js/features/pull-view-file.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ function refreshViewedFilesSummary() {
2020
.replace('%[2]d', prReview.numberOfFiles);
2121
}
2222

23-
// Explicitly recounts how many files the user has currently reviewed by counting the number of checked "viewed" checkboxes
24-
// Additionally, the viewed files summary will be updated if it exists
25-
export function countAndUpdateViewedFiles() {
26-
// The number of files is constant, but the number of viewed files can change because files can be loaded dynamically
27-
prReview.numberOfViewedFiles = document.querySelectorAll(`${viewedCheckboxSelector} > input[type=checkbox][checked]`).length;
28-
refreshViewedFilesSummary();
29-
}
30-
3123
// Initializes a listener for all children of the given html element
3224
// (for example 'document' in the most basic case)
3325
// to watch for changes of viewed-file checkboxes

web_src/js/features/repo-diff.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {initRepoIssueContentHistory} from './repo-issue-content.ts';
22
import {initDiffFileTree} from './repo-diff-filetree.ts';
33
import {initDiffCommitSelect} from './repo-diff-commitselect.ts';
44
import {validateTextareaNonEmpty} from './comp/ComboMarkdownEditor.ts';
5-
import {initViewedCheckboxListenerFor, countAndUpdateViewedFiles, initExpandAndCollapseFilesButton} from './pull-view-file.ts';
5+
import {initViewedCheckboxListenerFor, initExpandAndCollapseFilesButton} from './pull-view-file.ts';
66
import {initImageDiff} from './imagediff.ts';
77
import {showErrorToast} from '../modules/toast.ts';
88
import {submitEventSubmitter, queryElemSiblings, hideElem, showElem, animateOnce, addDelegatedEventListener, createElementFromHTML, queryElems} from '../utils/dom.ts';
@@ -152,7 +152,6 @@ function onShowMoreFiles() {
152152
// TODO: replace these calls with the "observer.ts" methods
153153
initRepoIssueContentHistory();
154154
initViewedCheckboxListenerFor();
155-
countAndUpdateViewedFiles();
156155
initImageDiff();
157156
initDiffHeaderPopup();
158157
}

0 commit comments

Comments
 (0)