private async void SendExecute() { if (string.IsNullOrEmpty(_recoveryCode)) { RaisePropertyChanged("RECOVERY_CODE_INVALID"); return; } var response = await ProtoService.SendAsync(new RecoverAuthenticationPassword(_recoveryCode)); if (response is Error error) { if (error.TypeEquals(ErrorType.CODE_INVALID)) { RecoveryCode = string.Empty; RaisePropertyChanged("RECOVERY_CODE_INVALID"); } else if (error.CodeEquals(ErrorCode.FLOOD)) { AlertsService.ShowFloodWaitAlert(error.Message); //await new MessageDialog($"{Resources.FloodWaitString}\r\n\r\n({result.Error.Message})", Resources.Error).ShowAsync(); } Logs.Logger.Error(Logs.Target.API, "account.checkPassword error " + error); } }
private async void SendExecute() { if (string.IsNullOrEmpty(_password)) { RaisePropertyChanged("PASSWORD_INVALID"); return; } var response = await ProtoService.SendAsync(new CheckAuthenticationPassword(_password)); if (response is Error error) { if (error.TypeEquals(ErrorType.PASSWORD_HASH_INVALID)) { Password = string.Empty; RaisePropertyChanged("PASSWORD_INVALID"); } else if (error.CodeEquals(ErrorCode.FLOOD)) { AlertsService.ShowFloodWaitAlert(error.Message); } Logs.Logger.Error(Logs.Target.API, "account.checkPassword error " + error); } }