[CHANGE] Get all account info

This commit is contained in:
max
2025-09-06 01:07:12 +02:00
parent f334c87fbb
commit fa0c617c9a
5 changed files with 94 additions and 38 deletions

View File

@@ -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;
}