Skip to content

Commit

Permalink
fix the issue that cannot remember latest game role of hoyolab toolbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Scighost committed Jan 15, 2024
1 parent 3e30633 commit 5c34483
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Starward/Pages/HoyolabToolbox/HoyolabToolboxPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,11 @@ private void InitializeNavigationViewItemVisibility()


[ObservableProperty]
[NotifyPropertyChangedFor(nameof(AvatarUrl))]
private GameRecordUser? currentUser;


[ObservableProperty]
[NotifyPropertyChangedFor(nameof(AvatarUrl))]
private GameRecordRole? currentRole;


Expand Down Expand Up @@ -302,6 +302,8 @@ private void ListView_GameRoles_SelectionChanged(object sender, SelectionChanged
if (e.AddedItems.FirstOrDefault() is GameRecordRole role)
{
CurrentRole = role;
_gameRecordService.SetLastSelectGameRecordRole(gameBiz, role);
CurrentUser = _gameRecordService.GetGameRecordUser(CurrentRole);
if (frame.SourcePageType?.Name is not nameof(LoginPage))
{
NavigateTo(frame.SourcePageType);
Expand Down

0 comments on commit 5c34483

Please sign in to comment.