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
|