public async void CheckActivation() { await WithProgress(activityIndicator, async() => { var created = await StellarHelper.CheckAccountCreated(App.Locator.Profile.KeyPair); if (created) { var trusted = await StellarHelper.CheckTokenTrusted(); if (trusted) { App.Locator.Profile.Activated = true; Application.Current.MainPage = new MainPage(); } else { var added = await StellarHelper.AddTrustToken(App.Locator.Profile.KeyPair); if (added) { App.Locator.Profile.Activated = true; Application.Current.MainPage = new MainPage(); } else { ShowMessage("Error adding trust token"); } } } else { ShowMessage("Stellar account isn't created yet"); } }); }
public async void CheckActivation() { var created = await StellarHelper.CheckAccountCreated(App.Locator.Profile.KeyPair); if (created) { var trusted = await StellarHelper.CheckTokenTrusted(); if (trusted) { App.Locator.Profile.Activated = true; var navigationPage = new NavigationPage(new MainPage()); Application.Current.MainPage = navigationPage; App.ShowLoading(false); } else { var added = await StellarHelper.AddTrustToken(App.Locator.Profile.KeyPair); if (added) { App.Locator.Profile.Activated = true; var navigationPage = new NavigationPage(new MainPage()); Application.Current.MainPage = navigationPage; App.ShowLoading(false); } else { App.ShowLoading(false); ShowErrorMessage(AppResources.ErrorAddTrustToken); } } } else { App.ShowLoading(false); ShowErrorMessage(AppResources.StellarAccountNotCreated); } }
private async void OnVerify(object sender, EventArgs e) { if (!ValidationHelper.ValidateTextField(entryCode.Text)) { entryCode.Focus(); } else { Unfocus(); if (!App.Locator.FriendlyService.IsFundWorking) { ShowErrorMessage(AppResources.RegistrationFundNotWorking); return; } var page = new WaitingAccountCreationPage(); await Navigation.PushAsync(page, false); await Task.Delay(1000); try { var result = await App.Locator.IdentityServiceClient.VerifyCode(entryCode.Text); if (result != null) { var trusted = await StellarHelper.CheckTokenTrusted(); if (trusted) { page.OpenMainPage(); } else { var added = await StellarHelper.AddTrustToken(App.Locator.Profile.KeyPair); if (added) { page.OpenMainPage(); } else { page.GoBack(); ShowErrorMessage(AppResources.ErrorAddTrustToken); } } } else { page.GoBack(); } } catch (Exception ex) { page.GoBack(); ShowErrorMessage(ex.Message); } } }