1
0
mirror of synced 2024-11-28 00:20:53 +01:00
TaikoLocalServer/TaikoWebUI/Pages/Song.razor
KIT! 3da94dbf9b 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.
2024-08-13 17:14:56 +02:00

38 lines
1.2 KiB
Plaintext

@page "/Users/{baid:int}/Songs/{songId:int}"
@using Blazored.LocalStorage
@using TaikoWebUI.Components.Song
@inject IGameDataService GameDataService
@inject HttpClient Client
@inject AuthService AuthService
@inject NavigationManager NavigationManager
@inject ILocalStorageService LocalStorage
@inject BreadcrumbsStateContainer BreadcrumbsStateContainer
@if (response is null)
{
<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 (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>
<MudGrid Class="my-4 pb-10">
<MudItem xs="12">
<SongLeaderboardCard SongId="@SongId" Baid="@Baid" />
</MudItem>
<MudItem xs="12">
<PlayHistoryCard Items="@songHistoryData" />
</MudItem>
</MudGrid>
}
}