@@ -36,11 +36,11 @@ export class ComposeInputModule extends ViewModule<ComposeView> {
36
36
}
37
37
38
38
public setHandlers = ( ) => {
39
+ this . configureRichTextFormatting ( ) ;
39
40
this . view . S . cached ( 'add_intro' ) . on (
40
41
'click' ,
41
42
this . view . setHandler ( el => this . actionAddIntroHandler ( el ) , this . view . errModule . handle ( `add intro` ) )
42
43
) ;
43
- this . initSquire ( this . isRichText ( ) ) ;
44
44
// Set lastDraftBody to current empty squire content ex: <div><br></div>)
45
45
// https://github.com/FlowCrypt/flowcrypt-browser/issues/5184
46
46
this . view . draftModule . setLastDraftBody ( this . squire . getHTML ( ) ) ;
@@ -54,7 +54,7 @@ export class ComposeInputModule extends ViewModule<ComposeView> {
54
54
} ;
55
55
56
56
public removeRichTextFormatting = ( ) => {
57
- if ( this . view . inputModule . isRichText ( ) ) {
57
+ if ( this . isRichText ( ) ) {
58
58
this . initSquire ( false , true ) ;
59
59
}
60
60
} ;
@@ -105,6 +105,14 @@ export class ComposeInputModule extends ViewModule<ComposeView> {
105
105
return isInputLimitExceeded ;
106
106
} ;
107
107
108
+ private configureRichTextFormatting = ( ) => {
109
+ if ( this . isRichText ( ) ) {
110
+ this . addRichTextFormatting ( ) ;
111
+ } else {
112
+ this . removeRichTextFormatting ( ) ;
113
+ }
114
+ } ;
115
+
108
116
private initSquire = ( addLinks : boolean , removeExistingLinks = false ) => {
109
117
const squireHtml = this . squire ?. getHTML ( ) ;
110
118
const el = this . view . S . cached ( 'input_text' ) . get ( 0 ) ;
0 commit comments