private async void ForgotExecute()
        {
            if (_passwordBase == null)
            {
                // TODO: ...
                return;
            }

            if (_passwordBase.HasRecovery)
            {
                IsLoading = true;

                var response = await LegacyService.RequestPasswordRecoveryAsync();

                if (response.IsSucceeded)
                {
                    await TLMessageDialog.ShowAsync(string.Format("We have sent a recovery code to the e-mail you provided:\n\n{0}", response.Result.EmailPattern), "Telegram", "OK");
                }
                else if (response.Error != null)
                {
                    IsLoading = false;
                    await new TLMessageDialog(response.Error.ErrorMessage ?? "Error message", response.Error.ErrorCode.ToString()).ShowQueuedAsync();
                }
            }
            else
            {
                await TLMessageDialog.ShowAsync("Since you haven't provided a recovery e-mail when setting up your password, your remaining options are either to remember your password or to reset your account.", "Sorry", "OK");

                //IsResettable = true;
            }
        }
Ejemplo n.º 2
0
        private async void ForgotExecute()
        {
            if (_parameters == null)
            {
                // TODO: ...
                return;
            }

            if (_parameters.Result.HasRecoveryEmailAddress)
            {
                IsLoading = true;

                var response = await LegacyService.RequestPasswordRecoveryAsync();

                if (response.IsSucceeded)
                {
                    await TLMessageDialog.ShowAsync(string.Format(Strings.Resources.RestoreEmailSent, response.Result.EmailPattern), Strings.Resources.AppName, Strings.Resources.OK);

                    // TODO: show recovery page
                }
                else if (response.Error != null)
                {
                    IsLoading = false;
                    await TLMessageDialog.ShowAsync(response.Error.ErrorMessage, Strings.Resources.AppName, Strings.Resources.OK);
                }
            }
            else
            {
                await TLMessageDialog.ShowAsync(Strings.Resources.RestorePasswordNoEmailText, Strings.Resources.RestorePasswordNoEmailTitle, Strings.Resources.OK);

                IsResettable = true;
            }
        }