Skip to content

Commit

Permalink
Update View button
Browse files Browse the repository at this point in the history
  • Loading branch information
Al12rs committed Feb 20, 2025
1 parent 030f56c commit 743a7d3
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions src/NexusMods.App.UI/Pages/MyGames/MyGamesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public MyGamesViewModel(

vm.ViewGameCommand = ReactiveCommand.Create(() =>
{
NavigateToFirstLoadout(conn, installation);
NavigateToFirstLoadoutLibrary(conn, installation);
Tracking.AddEvent(Events.Game.ViewGame, new EventMetadata(name: installation.Game.Name));
});

Expand Down Expand Up @@ -207,35 +207,6 @@ private Optional<LoadoutId> GetFirstLoadoutId(IConnection conn, GameInstallation

return loadout.HasValue ? loadout.Value.LoadoutId : Optional<LoadoutId>.None;
}

private void NavigateToFirstLoadout(IConnection conn, GameInstallation installation)
{
var fistLoadout = GetFirstLoadoutId(conn, installation);
if (!fistLoadout.HasValue) return;
var loadoutId = fistLoadout.Value;
Dispatcher.UIThread.Invoke(() =>
{
var workspaceController = _windowManager.ActiveWorkspaceController;

workspaceController.ChangeOrCreateWorkspaceByContext(
context => context.LoadoutId == loadoutId,
() => new PageData
{
FactoryId = LoadoutPageFactory.StaticId,
Context = new LoadoutPageContext()
{
LoadoutId = loadoutId,
GroupScope = Optional<LoadoutItemGroupId>.None,
},
},
() => new LoadoutContext
{
LoadoutId = loadoutId,
}
);
}
);
}

private void NavigateToFirstLoadoutLibrary(IConnection conn, GameInstallation installation)
{
Expand Down

0 comments on commit 743a7d3

Please sign in to comment.