@@ -36,11 +36,11 @@ export class ComposeInputModule extends ViewModule<ComposeView> {
3636 }
3737
3838 public setHandlers = ( ) => {
39+ this . configureRichTextFormatting ( ) ;
3940 this . view . S . cached ( 'add_intro' ) . on (
4041 'click' ,
4142 this . view . setHandler ( el => this . actionAddIntroHandler ( el ) , this . view . errModule . handle ( `add intro` ) )
4243 ) ;
43- this . initSquire ( this . isRichText ( ) ) ;
4444 // Set lastDraftBody to current empty squire content ex: <div><br></div>)
4545 // https://github.com/FlowCrypt/flowcrypt-browser/issues/5184
4646 this . view . draftModule . setLastDraftBody ( this . squire . getHTML ( ) ) ;
@@ -54,7 +54,7 @@ export class ComposeInputModule extends ViewModule<ComposeView> {
5454 } ;
5555
5656 public removeRichTextFormatting = ( ) => {
57- if ( this . view . inputModule . isRichText ( ) ) {
57+ if ( this . isRichText ( ) ) {
5858 this . initSquire ( false , true ) ;
5959 }
6060 } ;
@@ -105,6 +105,14 @@ export class ComposeInputModule extends ViewModule<ComposeView> {
105105 return isInputLimitExceeded ;
106106 } ;
107107
108+ private configureRichTextFormatting = ( ) => {
109+ if ( this . isRichText ( ) ) {
110+ this . addRichTextFormatting ( ) ;
111+ } else {
112+ this . removeRichTextFormatting ( ) ;
113+ }
114+ } ;
115+
108116 private initSquire = ( addLinks : boolean , removeExistingLinks = false ) => {
109117 const squireHtml = this . squire ?. getHTML ( ) ;
110118 const el = this . view . S . cached ( 'input_text' ) . get ( 0 ) ;
0 commit comments