diff --git a/src/dashboard/CloudStreams.Dashboard/Components/Timeline/Timeline.razor b/src/dashboard/CloudStreams.Dashboard/Components/Timeline/Timeline.razor index 81796d6c..b8a22fa1 100644 --- a/src/dashboard/CloudStreams.Dashboard/Components/Timeline/Timeline.razor +++ b/src/dashboard/CloudStreams.Dashboard/Components/Timeline/Timeline.razor @@ -163,7 +163,12 @@ } var start = entries.First().Time!.Value; var end = entries.Last().Time!.Value; - var margin = end.Subtract(start).TotalMilliseconds / 20; + var delta = end.Subtract(start).TotalMilliseconds; + if (delta == 0) + { + delta = 20; + } + var margin = delta / 20; await this.eventDropsInterop.RenderTimelineAsync(this.timeline, this.dotnetReference, timelineLanes, start, end.AddMilliseconds(margin)); } diff --git a/src/dashboard/CloudStreams.Dashboard/Pages/CloudEvents/List/Store.cs b/src/dashboard/CloudStreams.Dashboard/Pages/CloudEvents/List/Store.cs index f0fe1ae2..735bab32 100644 --- a/src/dashboard/CloudStreams.Dashboard/Pages/CloudEvents/List/Store.cs +++ b/src/dashboard/CloudStreams.Dashboard/Pages/CloudEvents/List/Store.cs @@ -110,7 +110,7 @@ public async ValueTask> ProvideCloudEvents(Items { readOptions = readOptions with { Partition = null }; } - var totalCount = (int?)this.Get(state => state.TotalCount) ?? 100; + var totalCount = (int?)this.Get(state => state.TotalCount) ?? 0; if (readOptions.Direction == StreamReadDirection.Forwards) { readOptions.Offset = (readOptions.Offset ?? 0) + request.StartIndex; diff --git a/src/dashboard/CloudStreams.Dashboard/Pages/CloudEvents/List/View.razor b/src/dashboard/CloudStreams.Dashboard/Pages/CloudEvents/List/View.razor index 5be483ba..f7d9bd63 100644 --- a/src/dashboard/CloudStreams.Dashboard/Pages/CloudEvents/List/View.razor +++ b/src/dashboard/CloudStreams.Dashboard/Pages/CloudEvents/List/View.razor @@ -109,7 +109,6 @@ Offcanvas? offcanvas; ReadOptionsForm? readOptionForm; Virtualize? virtualize; - bool readOptionsInitialized = false; /// protected override async Task OnInitializedAsync() @@ -121,7 +120,7 @@ (_, _) => true ) .Throttle(TimeSpan.FromMilliseconds(300)) - .SubscribeAsync(this.OnReadOptionChangedAsync, null, null, cancellationToken: this.CancellationTokenSource.Token); + .SubscribeAsync(this.OnReadOptionChangedAsync, null!, null!, cancellationToken: this.CancellationTokenSource.Token); } /// @@ -139,11 +138,6 @@ /// private async Task OnReadOptionChangedAsync(bool _) { - if (!this.readOptionsInitialized) - { - this.readOptionsInitialized = true; - return; - } if (this.virtualize != null) { await this.virtualize.RefreshDataAsync();