From 3da94dbf9bdda87acc557f4abfa3f541a895b049 Mon Sep 17 00:00:00 2001 From: KIT! Date: Tue, 13 Aug 2024 17:14:26 +0200 Subject: [PATCH] Fixed Song page always behaving like user was not logged in Uppon refresh, the page would always send you back to the dashboard and broke the breadcrumbs. --- TaikoWebUI/Pages/Song.razor | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/TaikoWebUI/Pages/Song.razor b/TaikoWebUI/Pages/Song.razor index 2dabfbb..0db1846 100644 --- a/TaikoWebUI/Pages/Song.razor +++ b/TaikoWebUI/Pages/Song.razor @@ -9,13 +9,19 @@ @inject ILocalStorageService LocalStorage @inject BreadcrumbsStateContainer BreadcrumbsStateContainer -@if (AuthService.LoginRequired && (!AuthService.IsLoggedIn || (AuthService.GetLoggedInBaid() != Baid && !AuthService.IsAdmin))) +@if (response is null) { - NavigationManager.NavigateTo(AuthService.IsLoggedIn ? "/" : "/Login"); + + + } else { - if (response is not null) + @if (AuthService.LoginRequired && (!AuthService.IsLoggedIn || (AuthService.GetLoggedInBaid() != Baid && !AuthService.IsAdmin))) + { + NavigationManager.NavigateTo(AuthService.IsLoggedIn ? "/" : "/Login"); + } + else { @songTitle @songArtist