From 599ff6aaba9f6bf90f80d86a86aa6f90bba07142 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 15 Feb 2022 11:48:25 +0100 Subject: [PATCH] =?UTF-8?q?Semplificaizone=20men=C3=B9=20top?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GWMS.UI/Components/CmpTop.razor | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/GWMS.UI/Components/CmpTop.razor b/GWMS.UI/Components/CmpTop.razor index 44cae0e..31ba451 100644 --- a/GWMS.UI/Components/CmpTop.razor +++ b/GWMS.UI/Components/CmpTop.razor @@ -4,7 +4,6 @@ @using GWMS.UI.Data @inject MessageService AppMessages -@inject AuthenticationStateProvider AuthenticationStateProvider
@@ -23,20 +22,17 @@ @code { - [CascadingParameter] - private Task AuthenticationStateTask { get; set; } [CascadingParameter(Name = "ShowSearch")] private bool ShowSearch { get; set; } - private string userName = ""; private string PageName { get; set; } private string PageIcon { get; set; } protected override async Task OnInitializedAsync() { - await forceReload(); + await Task.Delay(0); } protected override void OnInitialized() @@ -58,21 +54,6 @@ AppMessages.EA_PageUpdated -= OnPageUpdate; } - private async Task forceReload() - { - - var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync(); - var user = authState.User; - - if (user.Identity.IsAuthenticated) - { - userName = $"{user.Identity.Name}"; - } - else - { - userName = "N.A."; - } - } } @* // Vedere anche: