the instance last logged into might not exist anymore
This commit is contained in:
parent
1d9099284b
commit
b344f5c492
1 changed files with 14 additions and 1 deletions
|
@ -26,7 +26,20 @@ namespace WMstodon
|
|||
|
||||
protected async override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
string accountJSON = await (await HTTPUtils.GETAsync("/api/v1/accounts/verify_credentials")).Content.ReadAsStringAsync();
|
||||
string accountJSON;
|
||||
|
||||
try
|
||||
{
|
||||
accountJSON = await (await HTTPUtils.GETAsync("/api/v1/accounts/verify_credentials")).Content.ReadAsStringAsync();
|
||||
}
|
||||
catch
|
||||
{
|
||||
localSettings.Values["instanceURL"] = null;
|
||||
localSettings.Values["accessToken"] = null;
|
||||
Frame.Navigate(typeof(SelectInstancePage), null);
|
||||
return;
|
||||
}
|
||||
|
||||
myAccount = JsonConvert.DeserializeObject<Account>(accountJSON);
|
||||
|
||||
DisplayNameTextBlock.Text = $"{myAccount.display_name}";
|
||||
|
|
Loading…
Add table
Reference in a new issue