Skip to content

Commit

Permalink
fix: uncaught exception when cancelling prompt when creating note fro…
Browse files Browse the repository at this point in the history
…m template and `throw_on_cancel` is true

refs: #1294
  • Loading branch information
Zachatoo committed Jan 20, 2024
1 parent 5bad136 commit 78efee3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/core/functions/internal_functions/system/PromptModal.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { TemplaterError } from "utils/Error";
import {
ButtonComponent,
Modal,
Platform,
TextAreaComponent,
TextComponent,
} from "obsidian";
import { TemplaterError } from "utils/Error";

export class PromptModal extends Modal {
private resolve: (value: string) => void;
Expand All @@ -29,9 +29,7 @@ export class PromptModal extends Modal {
onClose(): void {
this.contentEl.empty();
if (!this.submitted) {
// TOFIX: for some reason throwing TemplaterError on iOS causes the app to freeze.
// this.reject(new TemplaterError("Cancelled prompt"));
this.reject();
this.reject(new TemplaterError("Cancelled prompt"));
}
}

Expand Down

0 comments on commit 78efee3

Please sign in to comment.