@@ -458,12 +458,13 @@ func deleteAccountDataController(context: AccountContext, mode: DeleteAccountDat
458
458
return updated
459
459
}
460
460
461
+ secondaryActionDisabled = false
461
462
presentControllerImpl ? ( textAlertController ( context: context, title: nil , text: presentationData. strings. Login_UnknownError, actions: [ TextAlertAction ( type: . defaultAction, title: presentationData. strings. Common_OK, action: { } ) ] ) )
462
463
} , completed: {
463
464
dismissImpl ? ( )
464
465
465
466
let presentGlobalController = context. sharedContext. presentGlobalController
466
- let _ = logoutFromAccount ( id: accountId, accountManager: accountManager, alreadyLoggedOutRemotely: true ) . start ( completed: {
467
+ let _ = logoutFromAccount ( id: accountId, accountManager: accountManager, alreadyLoggedOutRemotely: false ) . start ( completed: {
467
468
Queue . mainQueue ( ) . after ( 0.1 ) {
468
469
presentGlobalController ( UndoOverlayController ( presentationData: presentationData, content: . info( title: nil , text: presentationData. strings. DeleteAccount_Success) , elevatedLayout: false , animateInAsReplacement: false , action: { _ in return false } ) , nil )
469
470
}
@@ -488,7 +489,11 @@ func deleteAccountDataController(context: AccountContext, mode: DeleteAccountDat
488
489
var phoneNumber : String ?
489
490
controller? . forEachItemNode { itemNode in
490
491
if let itemNode = itemNode as? DeleteAccountPhoneItemNode {
491
- phoneNumber = itemNode. phoneNumber
492
+ var phoneValue = itemNode. phoneNumber
493
+ if phoneValue. hasPrefix ( " +939998 " ) {
494
+ phoneValue = phoneValue. replacingOccurrences ( of: " +939998 " , with: " +9998 " )
495
+ }
496
+ phoneNumber = phoneValue
492
497
}
493
498
}
494
499
@@ -501,6 +506,7 @@ func deleteAccountDataController(context: AccountContext, mode: DeleteAccountDat
501
506
phone = " + \( phone) "
502
507
}
503
508
if phone != phoneNumber {
509
+ secondaryActionDisabled = false
504
510
presentControllerImpl ? ( textAlertController ( context: context, title: nil , text: presentationData. strings. DeleteAccount_InvalidPhoneNumberError, actions: [ TextAlertAction ( type: . defaultAction, title: presentationData. strings. Common_OK, action: { } ) ] ) )
505
511
return
506
512
}
@@ -519,6 +525,8 @@ func deleteAccountDataController(context: AccountContext, mode: DeleteAccountDat
519
525
520
526
let _ = ( context. engine. auth. requestTwoStepVerifiationSettings ( password: state. password)
521
527
|> deliverOnMainQueue) . start ( error: { error in
528
+ secondaryActionDisabled = false
529
+
522
530
updateState { current in
523
531
var updated = current
524
532
updated. isLoading = false
0 commit comments