Skip to content

Commit

Permalink
Update Profile.razor
Browse files Browse the repository at this point in the history
  • Loading branch information
neozhu committed May 11, 2024
1 parent 9868db6 commit 4703070
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions src/Server.UI/Pages/Identity/Users/Profile.razor
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,7 @@ else
</MudTabPanel>
</MudTabs>
}
@{
var v = _computed.ValueOrDefault;
}
@foreach(var a in v)
{
@(a.Name + " / " + a.TenantName + "; ")
}



@code {
Expand All @@ -184,7 +178,6 @@ else
private IDisposable StateSubscription;
private bool Disposed;

private ActualLab.Fusion.Computed<UserInfo[]> _computed;
private async void ActivePanelIndexChanged(int index)
{
if (index == 2)
Expand Down Expand Up @@ -223,7 +216,7 @@ else
await new OrgChart(JS).Create(_orgData);
}

protected override async Task OnInitializedAsync()
protected override void OnInitialized()
{
UserManager = Services.GetRequiredService<UserManager<ApplicationUser>>();
model = Mapper.Map<ChangeUserProfileModel>(UserProfile);
Expand All @@ -236,8 +229,6 @@ else
}

});
_computed =await ActualLab.Fusion.Computed.Capture(() => OnlineUserTracker.GetOnlineUsers());
_computed.Invalidated += StateOnStateChanged;
}

protected override void Dispose(bool disposing)
Expand All @@ -247,15 +238,7 @@ else
base.Dispose(disposing);
}

private void StateOnStateChanged(ActualLab.Fusion.IComputed v)
{

InvokeAsync(async() => { StateHasChanged();
_computed.Invalidate();
_computed = await _computed.Update();
});

}


private async Task UploadPhoto(IBrowserFile file)
{
Expand Down

0 comments on commit 4703070

Please sign in to comment.