aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features/pull-view-file.js
diff options
context:
space:
mode:
Diffstat (limited to 'web_src/js/features/pull-view-file.js')
-rw-r--r--web_src/js/features/pull-view-file.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/web_src/js/features/pull-view-file.js b/web_src/js/features/pull-view-file.js
index daa520ea7e..90ea805160 100644
--- a/web_src/js/features/pull-view-file.js
+++ b/web_src/js/features/pull-view-file.js
@@ -1,3 +1,4 @@
+import {diffTreeStore} from '../modules/stores.js';
import {setFileFolding} from './file-fold.js';
const {csrfToken, pageData} = window.config;
@@ -53,9 +54,17 @@ export function initViewedCheckboxListenerFor() {
const hasChangedLabel = form.parentNode.querySelector('.changed-since-last-review');
hasChangedLabel?.remove();
+ const fileName = checkbox.getAttribute('name');
+
+ // check if the file is in our difftreestore and if we find it -> change the IsViewed status
+ const fileInPageData = diffTreeStore().files.find((x) => x.Name === fileName);
+ if (fileInPageData) {
+ fileInPageData.IsViewed = this.checked;
+ }
+
// Unfortunately, actual forms cause too many problems, hence another approach is needed
const files = {};
- files[checkbox.getAttribute('name')] = this.checked;
+ files[fileName] = this.checked;
const data = {files};
const headCommitSHA = form.getAttribute('data-headcommit');
if (headCommitSHA) data.headCommitSHA = headCommitSHA;