@@ -42,7 +42,6 @@ export interface PassphraseOptions {
4242
4343export interface SetupOptions extends PassphraseOptions {
4444 submit_main : boolean ;
45- submit_all : boolean ;
4645 recovered ?: boolean ;
4746}
4847/* eslint-enable @typescript-eslint/naming-convention */
@@ -72,7 +71,6 @@ export class SetupView extends View {
7271 public fetchedKeyBackupsUniqueLongids : string [ ] = [ ] ;
7372 public importedKeysUniqueLongids : string [ ] = [ ] ;
7473 public mathingPassphrases : string [ ] = [ ] ;
75- public submitKeyForAddrs : string [ ] ;
7674
7775 public constructor ( ) {
7876 super ( ) ;
@@ -89,8 +87,7 @@ export class SetupView extends View {
8987 } else {
9088 window . location . href = 'index.htm' ;
9189 }
92- this . submitKeyForAddrs = [ ] ;
93- this . keyImportUi . initPrvImportSrcForm ( this . acctEmail , this . parentTabId , this . submitKeyForAddrs ) ; // for step_2b_manual_enter, if user chooses so
90+ this . keyImportUi . initPrvImportSrcForm ( this . acctEmail , this . parentTabId ) ; // for step_2b_manual_enter, if user chooses so
9491 this . keyImportUi . onBadPassphrase = ( ) => $ ( '#step_2b_manual_enter .input_passphrase' ) . val ( '' ) . trigger ( 'focus' ) ;
9592 this . keyImportUi . renderPassPhraseStrengthValidationInput (
9693 $ ( '#step_2_ekm_choose_pass_phrase .input_password' ) ,
@@ -155,6 +152,8 @@ export class SetupView extends View {
155152 $ ( '.remove_if_backup_not_allowed' ) . remove ( ) ;
156153 }
157154 await this . setupRender . renderInitial ( ) ;
155+
156+ await this . keyImportUi . renderEmailAliasView ( this . acctEmail ) ;
158157 } ;
159158
160159 public setHandlers = ( ) => {
@@ -203,7 +202,7 @@ export class SetupView extends View {
203202 ) ;
204203 $ ( '.input_submit_key' ) . on (
205204 'click' ,
206- this . setHandler ( el => this . actionSubmitPublicKeyToggleHandler ( el ) )
205+ this . setHandler ( el => this . keyImportUi . actionSubmitPublicKeyToggleHandler ( el ) )
207206 ) ;
208207 $ ( '#step_0_backup_to_designated_mailbox .action_manual_create_key, #step_1_easy_or_manual .action_manual_create_key' ) . on (
209208 'click' ,
@@ -285,19 +284,6 @@ export class SetupView extends View {
285284 ) ;
286285 } ;
287286
288- public actionSubmitPublicKeyToggleHandler = ( target : HTMLElement ) => {
289- // will be hidden / ignored / forced true when rules.mustSubmitToAttester() === true (for certain orgs)
290- const inputSubmitAll = $ ( target ) . closest ( '.manual' ) . find ( '.input_submit_all' ) . first ( ) ;
291- if ( $ ( target ) . prop ( 'checked' ) ) {
292- if ( inputSubmitAll . closest ( 'div.line' ) . css ( 'visibility' ) === 'visible' ) {
293- $ ( '.input_email_alias' ) . prop ( { disabled : false } ) ;
294- }
295- } else {
296- $ ( '.input_email_alias' ) . prop ( { checked : false } ) ;
297- $ ( '.input_email_alias' ) . prop ( { disabled : true } ) ;
298- }
299- } ;
300-
301287 public actionCloseHandler = ( ) => {
302288 if ( this . parentTabId ) {
303289 BrowserMsg . send . redirect ( this . parentTabId , {
@@ -309,18 +295,24 @@ export class SetupView extends View {
309295 } ;
310296
311297 /* eslint-disable @typescript-eslint/naming-convention */
312- public submitPublicKeys = async ( { submit_main, submit_all } : { submit_main : boolean ; submit_all : boolean } ) : Promise < void > => {
298+ public submitPublicKeys = async ( { submit_main } : { submit_main : boolean } ) : Promise < void > => {
313299 const mostUsefulPrv = KeyStoreUtil . chooseMostUseful ( await KeyStoreUtil . parse ( await KeyStore . getRequired ( this . acctEmail ) ) , 'ONLY-FULLY-USABLE' ) ;
314300 try {
315- await submitPublicKeyIfNeeded ( this . clientConfiguration , this . acctEmail , this . submitKeyForAddrs , this . pubLookup . attester , mostUsefulPrv ?. keyInfo . public , {
316- submit_main,
317- submit_all,
318- } ) ;
301+ await submitPublicKeyIfNeeded (
302+ this . clientConfiguration ,
303+ this . acctEmail ,
304+ this . keyImportUi . getSelectedEmailAliases ( 'submit_pubkey' ) . map ( alias => alias . email ) ,
305+ this . pubLookup . attester ,
306+ mostUsefulPrv ?. keyInfo . public ,
307+ {
308+ submit_main,
309+ }
310+ ) ;
319311 } catch ( e ) {
320312 return await Settings . promptToRetry (
321313 e ,
322314 e instanceof CompanyLdapKeyMismatchError ? Lang . setup . failedToImportUnknownKey : Lang . setup . failedToSubmitToAttester ,
323- ( ) => this . submitPublicKeys ( { submit_main, submit_all } ) ,
315+ ( ) => this . submitPublicKeys ( { submit_main } ) ,
324316 Lang . general . contactIfNeedAssistance ( this . isCustomerUrlFesUsed ( ) )
325317 ) ;
326318 }
0 commit comments