From a19d1a331f13d5f8ed8a989de6274ac6bd9c7f81 Mon Sep 17 00:00:00 2001 From: Sara Gowen <9001998+dynamictulip@users.noreply.github.com> Date: Wed, 13 May 2026 20:28:19 +0100 Subject: [PATCH 1/3] WIP --- .../Features/Home/Components/EventData.razor | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Home/Components/EventData.razor b/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Home/Components/EventData.razor index a93c61c..3a78557 100644 --- a/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Home/Components/EventData.razor +++ b/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Home/Components/EventData.razor @@ -8,7 +8,7 @@ @foreach (var timeSlot in State.Value.Timeslots) { - + @timeSlot.From.LocalDateTime.ToString("h:mm") @@ -140,6 +140,36 @@ @code { + private bool _hasScrolledToCurrentTime; + + protected override void OnAfterRender(bool firstRender) + { + base.OnAfterRender(firstRender); + + if (_hasScrolledToCurrentTime || State.Value.Timeslots.Count == 0) + return; + + var currentTimeSlot = GetCurrentTimeSlot(); + if (currentTimeSlot is null) + return; + + _hasScrolledToCurrentTime = true; + NavigationManager.NavigateTo($"#{GetTimeSlotId(currentTimeSlot)}", false); + } + + private TimeSlot? GetCurrentTimeSlot() + { + // var now = DateTime.Now.TimeOfDay; + var now =(new DateTime(2026, 05, 13, 13, 13, 13)).TimeOfDay; + + return State.Value.Timeslots + .OrderBy(timeSlot => Math.Abs((timeSlot.From.LocalDateTime.TimeOfDay - now).TotalMinutes)) + .FirstOrDefault(); + } + + private static string GetTimeSlotId(TimeSlot timeSlot) => + $"timeslot-{timeSlot.From.LocalDateTime:HHmm}"; + void HandleViewSession(int sessionId) { NavigationManager.NavigateTo($"session/{sessionId}"); From 5ee25a313d4fe05bbe3ea0c54232d892755ea032 Mon Sep 17 00:00:00 2001 From: Sara Gowen <9001998+dynamictulip@users.noreply.github.com> Date: Fri, 15 May 2026 13:42:18 +0100 Subject: [PATCH 2/3] Undo test code --- .../Features/Home/Components/EventData.razor | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Home/Components/EventData.razor b/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Home/Components/EventData.razor index 3a78557..7aeb146 100644 --- a/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Home/Components/EventData.razor +++ b/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Home/Components/EventData.razor @@ -159,8 +159,7 @@ private TimeSlot? GetCurrentTimeSlot() { - // var now = DateTime.Now.TimeOfDay; - var now =(new DateTime(2026, 05, 13, 13, 13, 13)).TimeOfDay; + var now = DateTime.Now.TimeOfDay; return State.Value.Timeslots .OrderBy(timeSlot => Math.Abs((timeSlot.From.LocalDateTime.TimeOfDay - now).TotalMinutes)) From 604b3efec18f69290595b88e004ebe9840fc979f Mon Sep 17 00:00:00 2001 From: Sara Gowen <9001998+dynamictulip@users.noreply.github.com> Date: Fri, 15 May 2026 13:49:36 +0100 Subject: [PATCH 3/3] Disable Redux DevTools in development environment Comment out Redux DevTools usage due to .NET 7 issues. --- PocketDDD.BlazorClient/PocketDDD.BlazorClient/Program.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Program.cs b/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Program.cs index c7280da..2916a1c 100644 --- a/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Program.cs +++ b/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Program.cs @@ -17,8 +17,9 @@ builder.Services.AddFluxor(o => { o.ScanAssemblies(typeof(Program).Assembly); - if (builder.HostEnvironment.IsDevelopment()) - o.UseReduxDevTools(); + // Removing because there are problems insttiating this since .NET 7 -> if you want to fix then ensure that all unintitialised-type build warnings are fixed + // if (builder.HostEnvironment.IsDevelopment()) + // o.UseReduxDevTools(); }); builder.Services.AddBlazoredLocalStorage(); @@ -30,4 +31,4 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); -await builder.Build().RunAsync(); \ No newline at end of file +await builder.Build().RunAsync();