Stage workspace controls after bootstrap

This commit is contained in:
2026-05-04 19:03:47 +02:00
parent da813583bd
commit e0b7d27ba7
8 changed files with 542 additions and 575 deletions

View File

@@ -12,11 +12,28 @@ public partial class Workspace : IAsyncDisposable
protected override async Task OnAfterRenderAsync(bool firstRender)
{
State.HasInteractiveRenderStarted = true;
if (!firstRender)
if (firstRender)
{
await Session.InitializeAsync();
HasSessionInitialized = true;
await InvokeAsync(StateHasChanged);
return;
}
if (!HasSessionInitialized)
return;
await Session.InitializeAsync();
IsInitialized = true;
if (!EnableCharacterControls)
{
EnableCharacterControls = true;
await InvokeAsync(StateHasChanged);
return;
}
if (EnableCustomRollComposer)
return;
EnableCustomRollComposer = true;
await InvokeAsync(StateHasChanged);
}
@@ -98,8 +115,10 @@ public partial class Workspace : IAsyncDisposable
[Parameter] public EventCallback<string?> LoggedOut { get; set; }
private bool IsInitialized { get; set; }
private WorkspaceState State { get; } = new();
private bool HasSessionInitialized { get; set; }
private bool EnableCharacterControls { get; set; }
private bool EnableCustomRollComposer { get; set; }
private WorkspaceCampaignScopeCoordinator Scope => m_Scope ??= new(State, Feedback, JS, WorkspaceQuery,
Play.EnsureSelectedCharacterActiveAsync, Play.RefreshSelectedCharacterSheetAsync, Play.RefreshCampaignLogAsync,