From 78efee3e44d4f8d7fe91dd5d6be605e318788b78 Mon Sep 17 00:00:00 2001 From: Zachatoo Date: Fri, 19 Jan 2024 21:27:47 -0700 Subject: [PATCH] fix: uncaught exception when cancelling prompt when creating note from template and `throw_on_cancel` is true refs: #1294 --- src/core/functions/internal_functions/system/PromptModal.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/functions/internal_functions/system/PromptModal.ts b/src/core/functions/internal_functions/system/PromptModal.ts index a6da8154..338f1596 100644 --- a/src/core/functions/internal_functions/system/PromptModal.ts +++ b/src/core/functions/internal_functions/system/PromptModal.ts @@ -1,4 +1,3 @@ -import { TemplaterError } from "utils/Error"; import { ButtonComponent, Modal, @@ -6,6 +5,7 @@ import { TextAreaComponent, TextComponent, } from "obsidian"; +import { TemplaterError } from "utils/Error"; export class PromptModal extends Modal { private resolve: (value: string) => void; @@ -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")); } }