removed logrocket and fixed Drawing UX
This commit is contained in:
@@ -17,6 +17,8 @@ public sealed class DrawingCatalogController : IDrawingCatalogController
|
||||
public IReadOnlyList<string> VisibleIds => _visible;
|
||||
public event Action ListChanged;
|
||||
|
||||
private UniTaskCompletionSource _firstPopulate;
|
||||
|
||||
public DrawingCatalogController(
|
||||
IDrawingTemplateCatalog catalog,
|
||||
IEventBus bus)
|
||||
@@ -28,9 +30,25 @@ public sealed class DrawingCatalogController : IDrawingCatalogController
|
||||
public async UniTask InitializeAsync(CancellationToken ct)
|
||||
{
|
||||
await _catalog.FetchAsync();
|
||||
|
||||
// No view listening (e.g. catalog view unassigned) — nothing will populate, so don't wait.
|
||||
if (ListChanged == null)
|
||||
{
|
||||
Refresh();
|
||||
return;
|
||||
}
|
||||
|
||||
// Hold here until the presenter reports the catalog is on screen, so the caller can keep
|
||||
// the loading screen up across the (async) thumbnail load + button spawn instead of
|
||||
// revealing an empty catalog that fills in a few frames later.
|
||||
_firstPopulate = new UniTaskCompletionSource();
|
||||
Refresh();
|
||||
using (ct.Register(() => _firstPopulate.TrySetResult()))
|
||||
await _firstPopulate.Task;
|
||||
}
|
||||
|
||||
public void NotifyPopulated() => _firstPopulate?.TrySetResult();
|
||||
|
||||
public void OnTemplateSelected(string id)
|
||||
{
|
||||
_bus.Publish(new DrawingSelectedSignal(id));
|
||||
|
||||
@@ -120,6 +120,8 @@ namespace Darkmatter.Features.DrawingCatalog
|
||||
_view.SetItems(vms);
|
||||
_view.SetPagination(_currentPage, _totalPages);
|
||||
|
||||
// Unblock InitializeAsync: items are now on screen, so the loading screen can hide.
|
||||
_controller.NotifyPopulated();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
Reference in New Issue
Block a user