1- import type { FuzzyMatch } from "obsidian" ;
1+ import type { FuzzyMatch } from "obsidian" ;
22import { FuzzySuggestModal , MarkdownRenderer } from "obsidian" ;
33import type IChoice from "../../types/choices/IChoice" ;
44import { ChoiceExecutor } from "../../choiceExecutor" ;
@@ -7,6 +7,8 @@ import type IMultiChoice from "../../types/choices/IMultiChoice";
77import type QuickAdd from "../../main" ;
88import type { IChoiceExecutor } from "../../IChoiceExecutor" ;
99
10+ const backLabel = "← Back" ;
11+
1012export default class ChoiceSuggester extends FuzzySuggestModal < IChoice > {
1113 private choiceExecutor : IChoiceExecutor = new ChoiceExecutor (
1214 this . app ,
@@ -34,6 +36,8 @@ export default class ChoiceSuggester extends FuzzySuggestModal<IChoice> {
3436 el . empty ( ) ;
3537 void MarkdownRenderer . renderMarkdown ( item . item . name , el , '' , this . plugin ) ;
3638 el . classList . add ( "quickadd-choice-suggestion" ) ;
39+ if ( item . item . name === backLabel )
40+ el . classList . add ( "quickadd-choice-suggestion-back" ) ;
3741 }
3842
3943 getItemText ( item : IChoice ) : string {
@@ -56,8 +60,8 @@ export default class ChoiceSuggester extends FuzzySuggestModal<IChoice> {
5660 private onChooseMultiType ( multi : IMultiChoice ) {
5761 const choices = [ ...multi . choices ] ;
5862
59- if ( multi . name != "← Back" )
60- choices . push ( new MultiChoice ( "← Back" ) . addChoices ( this . choices ) ) ;
63+ if ( multi . name !== backLabel )
64+ choices . push ( new MultiChoice ( backLabel ) . addChoices ( this . choices ) ) ;
6165
6266 ChoiceSuggester . Open ( this . plugin , choices ) ;
6367 }
0 commit comments