@@ -372,7 +372,11 @@ export default {
372
372
return this .loadingMessage ?? t (' mail' , ' Connecting' )
373
373
}
374
374
if (this .mode === ' manual' && this .useOauth ) {
375
- return this .account ? t (' mail' , ' Reconnect Google account' ) : t (' mail' , ' Sign in with Google' )
375
+ if (this .isGoogleAccount ) {
376
+ return this .account ? t (' mail' , ' Reconnect Google account' ) : t (' mail' , ' Sign in with Google' )
377
+ } else {
378
+ return this .account ? t (' mail' , ' Reconnect Microsoft account' ) : t (' mail' , ' Sign in with Microsoft' )
379
+ }
376
380
}
377
381
return this .account ? t (' mail' , ' Save' ) : t (' mail' , ' Connect' )
378
382
},
@@ -557,16 +561,15 @@ export default {
557
561
const account = await this .$store .dispatch (' startAccountSetup' , data)
558
562
if (this .useOauth ) {
559
563
this .loadingMessage = t (' mail' , ' Awaiting user consent' )
560
- this .feedback = t (' mail' , ' Account created. Please follow the pop-up instructions to link your Google account' )
561
- try {
562
564
if (this .isGoogleAccount ) {
565
+ this .feedback = t (' mail' , ' Account created. Please follow the pop-up instructions to link your Google account' )
563
566
await getUserConsent (
564
567
this .googleOauthUrl
565
568
.replace (' _accountId_' , account .id )
566
569
.replace (' _email_' , encodeURIComponent (account .emailAddress )),
567
570
)
568
571
} else {
569
- // Microsoft
572
+ this . feedback = t ( ' mail ' , ' Account created. Please follow the pop-up instructions to link your Microsoft account ' )
570
573
await getUserConsent (
571
574
this .microsoftOauthUrl
572
575
.replace (' _accountId_' , account .id )
@@ -592,13 +595,22 @@ export default {
592
595
})
593
596
if (this .useOauth ) {
594
597
this .loadingMessage = t (' mail' , ' Awaiting user consent' )
595
- this .feedback = t (' mail' , ' Account updated. Please follow the pop-up instructions to reconnect your Google account' )
596
598
try {
597
- await getUserConsent (
598
- this .googleOauthUrl
599
- .replace (' _accountId_' , account .id )
600
- .replace (' _email_' , encodeURIComponent (account .emailAddress )),
601
- )
599
+ if (this .isGoogleAccount ) {
600
+ this .feedback = t (' mail' , ' Account updated. Please follow the pop-up instructions to reconnect your Google account' )
601
+ await getUserConsent (
602
+ this .googleOauthUrl
603
+ .replace (' _accountId_' , account .id )
604
+ .replace (' _email_' , encodeURIComponent (account .emailAddress )),
605
+ )
606
+ } else {
607
+ this .feedback = t (' mail' , ' Account updated. Please follow the pop-up instructions to reconnect your Microsoft account' )
608
+ await getUserConsent (
609
+ this .microsoftOauthUrl
610
+ .replace (' _accountId_' , account .id )
611
+ .replace (' _email_' , encodeURIComponent (account .emailAddress )),
612
+ )
613
+ }
602
614
} catch (e) {
603
615
// Undo changes
604
616
await this .$store .dispatch (' updateAccount' , {
0 commit comments