feature: chose to login

This commit is contained in:
Tsanie Lily 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;

View File

@ -58,4 +58,5 @@
<ExportSuccess>视频已导出到照片库。</ExportSuccess>
<FailedResponse>无法获取返回结果。</FailedResponse>
<ConfirmSyncFavorite>要同步收藏吗?</ConfirmSyncFavorite>
<ConfirmLogin>当前身份为游客,是否跳转到登录页面?</ConfirmLogin>
</root>

View File

@ -38,6 +38,7 @@ namespace Pixiview.Resources
public static string ExportSuccess => GetResource(nameof(ExportSuccess));
public static string FailedResponse => GetResource(nameof(FailedResponse));
public static string ConfirmSyncFavorite => GetResource(nameof(ConfirmSyncFavorite));
public static string ConfirmLogin => GetResource(nameof(ConfirmLogin));
static readonly Dictionary<string, LanguageResource> dict = new Dictionary<string, LanguageResource>();