1
0
mirror of synced 2025-02-21 12:59:48 +01:00

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.
This commit is contained in:
Farewell_ 2024-08-13 17:14:26 +02:00
parent 833a1cb9d2
commit 3da94dbf9b

View File

@ -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");
<MudContainer Style="display:flex;margin:50px 0;align-items:center;justify-content:center;">
<MudProgressCircular Indeterminate="true" Size="Size.Large" Color="Color.Primary" />
</MudContainer>
}
else
{
if (response is not null)
@if (AuthService.LoginRequired && (!AuthService.IsLoggedIn || (AuthService.GetLoggedInBaid() != Baid && !AuthService.IsAdmin)))
{
NavigationManager.NavigateTo(AuthService.IsLoggedIn ? "/" : "/Login");
}
else
{
<MudText Typo="Typo.h5">@songTitle</MudText>
<MudText Typo="Typo.body2">@songArtist</MudText>