1
0
mirror of synced 2024-11-23 22:41:01 +01:00

Add user name functionality

This commit is contained in:
shiibe 2022-09-05 18:57:45 -04:00
parent 1f8726c46a
commit 5b6559620b
3 changed files with 6 additions and 4 deletions

View File

@ -19,4 +19,6 @@ public class UserSetting
public PlaySetting PlaySetting { get; set; } = new();
public int NotesPosition { get; set; }
public string MyDonName { get; set; } = String.Empty;
}

View File

@ -35,7 +35,8 @@ public class UserSettingsController : BaseController<UserSettingsController>
IsSkipOn = user.IsSkipOn,
NotesPosition = user.NotesPosition,
PlaySetting = PlaySettingConverter.ShortToPlaySetting(user.OptionSetting),
ToneId = user.SelectedToneId
ToneId = user.SelectedToneId,
MyDonName = user.MyDonName
};
return Ok(response);
}
@ -58,6 +59,7 @@ public class UserSettingsController : BaseController<UserSettingsController>
user.SelectedToneId = userSetting.ToneId;
user.AchievementDisplayDifficulty = userSetting.AchievementDisplayDifficulty;
user.OptionSetting = PlaySettingConverter.PlaySettingToShort(userSetting.PlaySetting);
user.MyDonName = userSetting.MyDonName;
context.Update(user);
await context.SaveChangesAsync();

View File

@ -16,7 +16,7 @@
<MudStack Spacing="6">
<h2>Profile Options</h2>
<MudTextField @bind-Value="name" Label="Name" Variant="Variant.Outlined"></MudTextField>
<MudTextField @bind-Value="@response.MyDonName" Label="Name" Variant="Variant.Outlined"></MudTextField>
<MudSelect @bind-Value="@response.IsDisplayAchievement"
Label="Is Display Achievement Panel">
@ -117,8 +117,6 @@
private bool isSavingOptions;
private string name = "DON-Chan";
private readonly string[] speedStrings = { "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9",
"2.0", "2.5", "3.0", "3.5", "4.0"};