[CHANGE] Get all account info
This commit is contained in:
@@ -29,17 +29,6 @@ namespace Manager.App.Components.Dialogs
|
||||
Client.CookieContainer.Add(new Cookie { Name = "SET_NAME", Domain = ".youtube.com" });
|
||||
}
|
||||
|
||||
private async Task RemoveCookie(Cookie? cookie)
|
||||
{
|
||||
if (cookie == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
cookie.Expired = true;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private void ToggleCookieTextImport()
|
||||
{
|
||||
_showCookieTextImport =! _showCookieTextImport;
|
||||
@@ -97,13 +86,27 @@ namespace Manager.App.Components.Dialogs
|
||||
|
||||
private bool CanSave()
|
||||
{
|
||||
return Client.ClientState is { LoggedIn: true };
|
||||
if (Client.ClientState == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Client.Id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return Client.SapisidCookie != null && Client.ClientState.LoggedIn;
|
||||
}
|
||||
|
||||
private async Task ValidateAccount()
|
||||
{
|
||||
_isLoading = true;
|
||||
await Client.BuildClientAsync();
|
||||
var result = await Client.BuildClientAsync();
|
||||
if (!result.IsSuccess)
|
||||
{
|
||||
SnackbarService.Add(result.Error?.Description ?? "Error validating account.", Severity.Error);
|
||||
}
|
||||
_isLoading = false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user