From 8838a3b20ba95bca34954b6ec828991adb028d4d Mon Sep 17 00:00:00 2001 From: Rory& Date: Mon, 10 Mar 2025 07:41:43 +0100 Subject: Various work --- ModerationClient/Views/UserManagementWindow.axaml.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'ModerationClient/Views/UserManagementWindow.axaml.cs') diff --git a/ModerationClient/Views/UserManagementWindow.axaml.cs b/ModerationClient/Views/UserManagementWindow.axaml.cs index 2d2dfb4..f5b4d56 100644 --- a/ModerationClient/Views/UserManagementWindow.axaml.cs +++ b/ModerationClient/Views/UserManagementWindow.axaml.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using ArcaneLibs.Extensions; using Avalonia; using Avalonia.Controls; @@ -64,7 +65,7 @@ public partial class UserManagementWindow : Window { dataContext.CurrentViewModel = App.Current.Host.Services.GetRequiredService(); } else { - dataContext.CurrentViewModel = new LoginViewModel(dataContext.AuthService); + Close(); } } }; @@ -118,7 +119,7 @@ public partial class UserManagementWindow : Window { return; } - if (button.Tag is not User user) { + if (button.Tag is not SynapseAdminUser user) { Console.WriteLine("WARN: Tag is not User, ignoring PuppetButtonClicked!"); return; } @@ -129,8 +130,14 @@ public partial class UserManagementWindow : Window { } var puppet = await synapse.Admin.LoginUserAsync(user.Name, TimeSpan.FromMinutes(5)); - - System.Diagnostics.Process.Start(System.Diagnostics.Process.GetCurrentProcess().MainModule!.FileName, - (_cfg with { IsTemporary = true, LoginData = puppet.ToJson() }).Serialise()); + // var currentProcess = System.Diagnostics.Process.GetCurrentProcess().MainModule!.FileName; + // if(Path.GetFileName(currentProcess) == "dotnet") { + // Console.WriteLine("WARN: Running in dotnet, trying again...!"); + // // get the path to the current executable + // var path = System.Reflection.Assembly.GetEntryAssembly()!.Location; + // Console.WriteLine(path); + // return; + // } + System.Diagnostics.Process.Start("steam-run", ["dotnet", System.Reflection.Assembly.GetEntryAssembly()!.Location, "--", ..(_cfg with { IsTemporary = true, LoginData = puppet.ToJson() }).Serialise()]); } } \ No newline at end of file -- cgit 1.5.1