Skip to content

Commit

Permalink
offline analysis: clear reviewing_file when you go back to the table
Browse files Browse the repository at this point in the history
  • Loading branch information
christianp committed Nov 8, 2024
1 parent b17b89a commit e460a83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions themes/default/files/scripts/analysis-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ Numbas.queueScript('analysis-display', ['base','download','util','csv','display-
return af;
}));
}
if(state.reviewing_file !== undefined && state.reviewing_file >=0) {
if(state.reviewing_file !== undefined && state.reviewing_file !== null && state.reviewing_file >=0) {
const af = this.uploaded_files()[state.reviewing_file];
af.decryptPromise.then(() => {
this.review_file(af);
Expand All @@ -501,7 +501,7 @@ Numbas.queueScript('analysis-display', ['base','download','util','csv','display-
current_tab: this.current_tab(),
table_format: this.table_format().label,
files: this.uploaded_files().map(f => f.as_json()),
reviewing_file: this.uploaded_files().indexOf(this.reviewing_file())
reviewing_file: this.current_tab() == 'review' ? this.uploaded_files().indexOf(this.reviewing_file()) : undefined
};

if(window.history.state?.current_tab != state.current_tab) {
Expand Down

0 comments on commit e460a83

Please sign in to comment.