From c4d958b8babb60e85133a62093bdbfd31b636eb7 Mon Sep 17 00:00:00 2001 From: Natsumi Date: Mon, 28 Oct 2024 14:48:29 +1300 Subject: [PATCH] Fixes --- Dotnet/StartupArgs.cs | 10 ++++++---- html/src/app.js | 12 +++++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Dotnet/StartupArgs.cs b/Dotnet/StartupArgs.cs index f9cb9bbe..ecee3115 100644 --- a/Dotnet/StartupArgs.cs +++ b/Dotnet/StartupArgs.cs @@ -12,6 +12,7 @@ using System.IO.Pipes; using System.Linq; using System.Management; using System.Text; +using System.Threading; using System.Windows.Forms; namespace VRCX @@ -50,6 +51,7 @@ namespace VRCX if (!disableClosing && IsDuplicateProcessRunning(LaunchArguments)) { IPCToMain(); + Thread.Sleep(10); Environment.Exit(0); } } @@ -97,13 +99,13 @@ namespace VRCX private static bool IsDuplicateProcessRunning(VrcxLaunchArguments launchArguments) { - var processes = Process.GetProcessesByName("VRCX") - .Where(x => x.Id != Environment.ProcessId); - + var processes = Process.GetProcessesByName("VRCX"); foreach (var process in processes) { + if (process.Id == Environment.ProcessId) + continue; + var commandLine = string.Empty; - try { using var searcher = new ManagementObjectSearcher("SELECT CommandLine FROM Win32_Process WHERE ProcessId = " + process.Id); diff --git a/html/src/app.js b/html/src/app.js index ac38aff8..e5821a77 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -2983,6 +2983,10 @@ speechSynthesis.getVoices(); break retryLoop; } catch (err) { console.error(err); + if (!API.currentUser.isLoggedIn) { + console.error(`User isn't logged in`); + break mainLoop; + } if (err?.message?.includes('Not Found')) { console.error('Awful workaround for awful VRC API bug'); break retryLoop; @@ -25534,6 +25538,10 @@ speechSynthesis.getVoices(); remainingGroups: [] }; var args = await API.getGroups({ userId }); + if (userId !== this.userDialog.id) { + this.userDialog.isGroupsLoading = false; + return; + } if (userId === API.currentUser.id) { // update current user groups API.currentUserGroups.clear(); @@ -33125,8 +33133,10 @@ speechSynthesis.getVoices(); D.selectedAuditLogTypes = []; API.getCachedGroup({ groupId }).then((args) => { D.groupRef = args.ref; + if (this.hasGroupPermission(D.groupRef, 'group-audit-view')) { + API.getGroupAuditLogTypes({ groupId }); + } }); - API.getGroupAuditLogTypes({ groupId }); this.groupMemberModerationTableForceUpdate = 0; D.visible = true; this.setGroupMemberModerationTable(this.groupDialog.members);