1
0
mirror of synced 2024-11-24 06:50:15 +01:00

Merge branch 'new-songs-ui' of https://github.com/asesidaa/TaikoLocalServer into LoginRefactor

This commit is contained in:
S-Sebb 2024-06-05 16:59:26 +01:00
commit 68d88322ba
2 changed files with 5 additions and 13 deletions

View File

@ -43,15 +43,7 @@ public partial class AccessCode
private async Task InitializeUser()
{
if (!AuthService.LoginRequired)
{
var users = await Client.GetFromJsonAsync<List<User>>("api/Users");
if (users != null) User = users.FirstOrDefault(u => u.Baid == Baid);
}
else if (AuthService.IsLoggedIn)
{
User = await Client.GetFromJsonAsync<User>($"api/Users/{Baid}");
}
User = await Client.GetFromJsonAsync<User>($"api/Users/{Baid}");
}
private async Task DeleteAccessCode(string accessCode)

View File

@ -9,11 +9,11 @@
<MudText Typo="Typo.h4">@Localizer["Users"]</MudText>
<MudGrid Class="my-8">
@if (!AuthService.LoginRequired || (AuthService.LoginRequired && AuthService.IsAdmin)) {
if (isLoading == true)
if (isLoading == true || response == null)
{
// Loading...
for (uint i = 0; i < 6; i++) {
<MudItem xs="12" md="6" lg="4">
for (uint i = 0; i < pageSize; i++) {
<MudItem xs="12" md="6" lg="4" xl="3">
<MudCard Outlined="true">
<MudCardContent>
<MudSkeleton Width="30%" Height="42px;" Class="mb-5" />
@ -32,7 +32,7 @@
} else if (response.Users.Count > 0) {
foreach (var user in response.Users)
{
<MudItem xs="12" md="6" lg="4">
<MudItem xs="12" md="6" lg="4" xl="3">
<UserCard User="user" UserSetting="user.UserSetting" />
</MudItem>
}