feature: chose to login

This commit is contained in:
2020-05-19 23:59:22 +08:00
parent 38fa6d4d21
commit d1ea0243b8
3 changed files with 23 additions and 14 deletions

View File

@@ -525,25 +525,32 @@ namespace Pixiview.Illust
illustData = DoLoadIllustData(force);
if (illustData == null)
{
if (isTrying)
MainThread.BeginInvokeOnMainThread(async () =>
{
MainThread.BeginInvokeOnMainThread(() =>
if (isTrying)
{
DisplayAlert(ResourceHelper.Title,
_ = DisplayAlert(ResourceHelper.Title,
ResourceHelper.FailedResponse + "\n" + lastError?.Substring(0, 40),
ResourceHelper.Ok);
});
isTrying = false;
}
else
{
isTrying = true;
AppShell.Current.PushToLogin(() =>
isTrying = false;
}
else
{
Task.Run(() => AppShell.Current.DoLoginInformation(true));
StartLoad(true);
});
}
//isTrying = true;
var result = await DisplayAlert(
ResourceHelper.Title,
ResourceHelper.ConfirmLogin,
ResourceHelper.Yes, ResourceHelper.No);
if (result)
{
AppShell.Current.PushToLogin(() =>
{
Task.Run(() => AppShell.Current.DoLoginInformation(true));
StartLoad(true);
});
}
}
});
//App.DebugError("illusts.load", "failed to load illusts data.");
IsLoading = false;
IsBottomLoading = false;