about summary refs log tree commit diff
path: root/ModerationClient/Views/UserManagementWindow.axaml.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-03-10 07:41:43 +0100
committerRory& <root@rory.gay>2025-03-10 07:41:43 +0100
commit8838a3b20ba95bca34954b6ec828991adb028d4d (patch)
tree4fb6d6efdb04107e10daf8dc311894c3f6050b34 /ModerationClient/Views/UserManagementWindow.axaml.cs
parentChanges (diff)
downloadModerationClient-8838a3b20ba95bca34954b6ec828991adb028d4d.tar.xz
Various work
Diffstat (limited to 'ModerationClient/Views/UserManagementWindow.axaml.cs')
-rw-r--r--ModerationClient/Views/UserManagementWindow.axaml.cs17
1 files changed, 12 insertions, 5 deletions
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<ClientViewModel>(); } 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