mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-03 05:03:45 +00:00
Account deletion fixes
This commit is contained in:
parent
0f38ee9930
commit
8112d11896
@ -458,12 +458,13 @@ func deleteAccountDataController(context: AccountContext, mode: DeleteAccountDat
|
||||
return updated
|
||||
}
|
||||
|
||||
secondaryActionDisabled = false
|
||||
presentControllerImpl?(textAlertController(context: context, title: nil, text: presentationData.strings.Login_UnknownError, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]))
|
||||
}, completed: {
|
||||
dismissImpl?()
|
||||
|
||||
let presentGlobalController = context.sharedContext.presentGlobalController
|
||||
let _ = logoutFromAccount(id: accountId, accountManager: accountManager, alreadyLoggedOutRemotely: true).start(completed: {
|
||||
let _ = logoutFromAccount(id: accountId, accountManager: accountManager, alreadyLoggedOutRemotely: false).start(completed: {
|
||||
Queue.mainQueue().after(0.1) {
|
||||
presentGlobalController(UndoOverlayController(presentationData: presentationData, content: .info(title: nil, text: presentationData.strings.DeleteAccount_Success), elevatedLayout: false, animateInAsReplacement: false, action: { _ in return false }), nil)
|
||||
}
|
||||
@ -488,7 +489,11 @@ func deleteAccountDataController(context: AccountContext, mode: DeleteAccountDat
|
||||
var phoneNumber: String?
|
||||
controller?.forEachItemNode { itemNode in
|
||||
if let itemNode = itemNode as? DeleteAccountPhoneItemNode {
|
||||
phoneNumber = itemNode.phoneNumber
|
||||
var phoneValue = itemNode.phoneNumber
|
||||
if phoneValue.hasPrefix("+939998") {
|
||||
phoneValue = phoneValue.replacingOccurrences(of: "+939998", with: "+9998")
|
||||
}
|
||||
phoneNumber = phoneValue
|
||||
}
|
||||
}
|
||||
|
||||
@ -501,6 +506,7 @@ func deleteAccountDataController(context: AccountContext, mode: DeleteAccountDat
|
||||
phone = "+\(phone)"
|
||||
}
|
||||
if phone != phoneNumber {
|
||||
secondaryActionDisabled = false
|
||||
presentControllerImpl?(textAlertController(context: context, title: nil, text: presentationData.strings.DeleteAccount_InvalidPhoneNumberError, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]))
|
||||
return
|
||||
}
|
||||
@ -519,6 +525,8 @@ func deleteAccountDataController(context: AccountContext, mode: DeleteAccountDat
|
||||
|
||||
let _ = (context.engine.auth.requestTwoStepVerifiationSettings(password: state.password)
|
||||
|> deliverOnMainQueue).start(error: { error in
|
||||
secondaryActionDisabled = false
|
||||
|
||||
updateState { current in
|
||||
var updated = current
|
||||
updated.isLoading = false
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user