Skip to content

Commit fb78afb

Browse files
committed
fix #7797 -- latex: clicking to download the pdf when the pdf doesn't exist silently fails
1 parent 407dc8c commit fb78afb

File tree

1 file changed

+10
-1
lines changed
  • src/packages/frontend/frame-editors/latex-editor

1 file changed

+10
-1
lines changed

src/packages/frontend/frame-editors/latex-editor/actions.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,9 +1494,18 @@ export class Actions extends BaseActions<LatexEditorState> {
14941494

14951495
download_pdf(): void {
14961496
const path: string = pdf_path(this.path);
1497+
1498+
// we use auto false and true, since the pdf may not exist, and we don't want
1499+
// a **silent failure**. With auto:false, the pdf appears in a new tab
1500+
// and user has to click again to actually get it on their computer, but
1501+
// auto:true makes it so it downloads automatically to avoid that click.
1502+
// If there is an error, that is clear too.
1503+
this.redux
1504+
.getProjectActions(this.project_id)
1505+
.download_file({ path, log: true, auto: false });
14971506
this.redux
14981507
.getProjectActions(this.project_id)
1499-
.download_file({ path: path, log: true });
1508+
.download_file({ path, log: false, auto: true });
15001509
}
15011510

15021511
print(id: string): void {

0 commit comments

Comments
 (0)