do not query follow/recommends when no cookie
This commit is contained in:
@ -521,57 +521,65 @@ namespace Pixiview.Illust
|
|||||||
|
|
||||||
#region - Illust Tasks -
|
#region - Illust Tasks -
|
||||||
|
|
||||||
|
private async void RedirectFailed()
|
||||||
|
{
|
||||||
|
if (!IsRedirectLogin)
|
||||||
|
{
|
||||||
|
string extra;
|
||||||
|
if (lastError != null)
|
||||||
|
{
|
||||||
|
if (lastError.Length > 40)
|
||||||
|
{
|
||||||
|
extra = $"\n{lastError.Substring(0, 40)}...";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
extra = $"\n{lastError}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
extra = string.Empty;
|
||||||
|
}
|
||||||
|
_ = DisplayAlert(ResourceHelper.Title,
|
||||||
|
ResourceHelper.FailedResponse + extra,
|
||||||
|
ResourceHelper.Ok);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
IsLoading = false;
|
||||||
|
IsBottomLoading = false;
|
||||||
|
}
|
||||||
|
|
||||||
protected void DoLoadIllusts(bool force = false, bool bottom = false)
|
protected void DoLoadIllusts(bool force = false, bool bottom = false)
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
App.DebugPrint($"start loading data, force: {force}");
|
App.DebugPrint($"start loading data, force: {force}");
|
||||||
#endif
|
#endif
|
||||||
|
if (force && string.IsNullOrEmpty(Configs.Cookie))
|
||||||
|
{
|
||||||
|
MainThread.BeginInvokeOnMainThread(RedirectFailed);
|
||||||
|
App.DebugPrint($"no cookie found");
|
||||||
|
return;
|
||||||
|
}
|
||||||
illustData = DoLoadIllustData(force);
|
illustData = DoLoadIllustData(force);
|
||||||
if (illustData == null)
|
if (illustData == null)
|
||||||
{
|
{
|
||||||
MainThread.BeginInvokeOnMainThread(async () =>
|
MainThread.BeginInvokeOnMainThread(RedirectFailed);
|
||||||
{
|
|
||||||
if (!IsRedirectLogin)
|
|
||||||
{
|
|
||||||
string extra;
|
|
||||||
if (lastError != null)
|
|
||||||
{
|
|
||||||
if (lastError.Length > 40)
|
|
||||||
{
|
|
||||||
extra = $"\n{lastError.Substring(0, 40)}...";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
extra = $"\n{lastError}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
extra = string.Empty;
|
|
||||||
}
|
|
||||||
_ = DisplayAlert(ResourceHelper.Title,
|
|
||||||
ResourceHelper.FailedResponse + extra,
|
|
||||||
ResourceHelper.Ok);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
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.");
|
//App.DebugError("illusts.load", "failed to load illusts data.");
|
||||||
IsLoading = false;
|
|
||||||
IsBottomLoading = false;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (force && IsFavoriteVisible)
|
if (force && IsFavoriteVisible)
|
||||||
|
Reference in New Issue
Block a user