File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -11,19 +11,15 @@ import { promptRenameChoice } from "../choiceRename";
1111
1212export abstract class ChoiceBuilder extends Modal {
1313 private resolvePromise : ( input : IChoice ) => void ;
14- private rejectPromise : ( reason ?: unknown ) => void ;
15- private input : IChoice ;
1614 public waitForClose : Promise < IChoice > ;
1715 abstract choice : IChoice ;
18- private didSubmit = false ;
1916 protected svelteElements : SvelteComponent [ ] = [ ] ;
2017
2118 protected constructor ( app : App ) {
2219 super ( app ) ;
2320
24- this . waitForClose = new Promise < IChoice > ( ( resolve , reject ) => {
21+ this . waitForClose = new Promise < IChoice > ( ( resolve ) => {
2522 this . resolvePromise = resolve ;
26- this . rejectPromise = reject ;
2723 } ) ;
2824
2925 this . containerEl . addClass ( "quickAddModal" ) ;
@@ -208,12 +204,9 @@ export abstract class ChoiceBuilder extends Modal {
208204
209205 onClose ( ) {
210206 super . onClose ( ) ;
211- this . resolvePromise ( this . choice ) ;
212207 this . svelteElements . forEach ( ( el ) => {
213208 if ( el && el . $destroy ) el . $destroy ( ) ;
214209 } ) ;
215-
216- if ( ! this . didSubmit ) this . rejectPromise ( "No answer given." ) ;
217- else this . resolvePromise ( this . input ) ;
210+ this . resolvePromise ( this . choice ) ;
218211 }
219212}
You can’t perform that action at this time.
0 commit comments