aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features/pull-view-file.ts
diff options
context:
space:
mode:
Diffstat (limited to 'web_src/js/features/pull-view-file.ts')
-rw-r--r--web_src/js/features/pull-view-file.ts9
1 files changed, 3 insertions, 6 deletions
diff --git a/web_src/js/features/pull-view-file.ts b/web_src/js/features/pull-view-file.ts
index 16ccf00084..1124886238 100644
--- a/web_src/js/features/pull-view-file.ts
+++ b/web_src/js/features/pull-view-file.ts
@@ -1,4 +1,4 @@
-import {diffTreeStore} from '../modules/stores.ts';
+import {diffTreeStore, diffTreeStoreSetViewed} from '../modules/diff-file.ts';
import {setFileFolding} from './file-fold.ts';
import {POST} from '../modules/fetch.ts';
@@ -58,11 +58,8 @@ export function initViewedCheckboxListenerFor() {
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: Record<string, any>) => x.Name === fileName);
- if (fileInPageData) {
- fileInPageData.IsViewed = this.checked;
- }
+ // check if the file is in our diffTreeStore and if we find it -> change the IsViewed status
+ diffTreeStoreSetViewed(diffTreeStore(), fileName, this.checked);
// Unfortunately, actual forms cause too many problems, hence another approach is needed
const files: Record<string, boolean> = {};