@@ -13,7 +13,6 @@ import {
1313import {
1414 canSend ,
1515 closeComposerWindow ,
16- closeWindowWithDraft ,
1716 createEmail ,
1817 getAlias ,
1918 isCriptextDomain ,
@@ -125,6 +124,7 @@ class ComposerWrapper extends Component {
125124 displayNotVerifiedRecoveryEmailPopup = {
126125 this . state . displayNotVerifiedRecoveryEmailPopup
127126 }
127+ displayRecoveryEmailSentPopup = { this . state . displayRecoveryEmailSentPopup }
128128 files = { this . state . files }
129129 getAccount = { this . hangleGetAccount }
130130 getBccEmails = { this . handleGetBccEmail }
@@ -152,6 +152,7 @@ class ComposerWrapper extends Component {
152152 this . handleTogglePopupNotVerifiedRecoveryEmail
153153 }
154154 onToggleRecipient = { this . handleToggleRecipient }
155+ onToggleRecoveryEmailSentPopup = { this . handleToggleRecoveryEmailSentPopup }
155156 status = { this . state . status }
156157 onSetNonCriptextRecipientsPassword = {
157158 this . handleSetNonCriptextRecipientsPassword
@@ -393,20 +394,25 @@ class ComposerWrapper extends Component {
393394
394395 handleConfirmVerifyRecoveryEmail = async ( ) => {
395396 const recoveryEmail = this . state . recoveryEmail ;
397+ this . saveTemporalDraft ( ) ;
396398 if ( recoveryEmail === '' ) {
397- this . saveTemporalDraft ( ) ;
398- sendEventToMailbox ( 'open-recovery-email-mailbox' , undefined ) ;
399+ const params = {
400+ recipientId : myAccount . recipientId ,
401+ accountId : myAccount . id
402+ } ;
399403 this . setState ( {
400404 displayNotVerifiedRecoveryEmailPopup : false
401405 } ) ;
402- closeWindowWithDraft ( ) ;
406+ sendEventToMailbox ( 'open-recovery-email-mailbox' , params ) ;
403407 return ;
404408 }
405409 this . setState ( {
406410 displayNotVerifiedRecoveryEmailPopup : false
407411 } ) ;
408- await resendConfirmationEmail ( ) ;
409- sendEventToMailbox ( 'send-recovery-email' , undefined ) ;
412+ this . setState ( {
413+ displayRecoveryEmailSentPopup : true
414+ } ) ;
415+ await resendConfirmationEmail ( { recipientId : myAccount . recipientId } ) ;
410416 } ;
411417
412418 handleTogglePopupNotVerifiedRecoveryEmail = ( ) => {
@@ -415,6 +421,12 @@ class ComposerWrapper extends Component {
415421 } ) ;
416422 } ;
417423
424+ handleToggleRecoveryEmailSentPopup = ( ) => {
425+ this . setState ( {
426+ displayRecoveryEmailSentPopup : false
427+ } ) ;
428+ } ;
429+
418430 handleDisableSendButtonOnInvalidEmail = ( ) => {
419431 this . setState ( prevState => {
420432 if ( prevState . status !== Status . DISABLED ) {
@@ -773,7 +785,9 @@ class ComposerWrapper extends Component {
773785 } ) ;
774786 } else {
775787 this . setState ( { status : Status . WAITING } ) ;
776- const { status, body } = await canSend ( ) ;
788+ const { status, body } = await canSend ( {
789+ recipientId : myAccount . recipientId . split ( '@' ) [ 0 ]
790+ } ) ;
777791
778792 if ( status === 405 ) {
779793 const recoveryEmail = body . data . recovery ;
0 commit comments