Fix launchcommands on Linux (#1352)

* feat: expose IPC listener to electron world

* feat: add listener + rouing to old function + remove old functions

* feat: register vrcx prefix + route launch arguments to electron
This commit is contained in:
kubectl
2025-08-27 02:52:17 +02:00
committed by GitHub
parent d0eca482fa
commit 21dcc51e83
4 changed files with 56 additions and 19 deletions

View File

@@ -516,12 +516,6 @@ export const useVrcxStore = defineStore('Vrcx', () => {
case 'MsgPing':
state.externalNotifierVersion = data.version;
break;
case 'LaunchCommand':
eventLaunchCommand(data.command);
break;
case 'VRCXLaunch':
console.log('VRCXLaunch:', data);
break;
default:
console.log('IPC:', data);
}
@@ -538,22 +532,17 @@ export const useVrcxStore = defineStore('Vrcx', () => {
watch(
() => watchState.isLoggedIn,
(isLoggedIn) => {
(_isLoggedIn) => {
state.isRegistryBackupDialogVisible = false;
if (isLoggedIn) {
startupLaunchCommand();
}
},
{ flush: 'sync' }
);
async function startupLaunchCommand() {
const command = await AppApi.GetLaunchCommand();
window.electron.ipcRenderer.on('launch-command', (command) => {
if (command) {
eventLaunchCommand(command);
eventLaunchCommand(command)
}
}
})
function eventLaunchCommand(input) {
if (!watchState.isLoggedIn) {
return;
@@ -766,8 +755,8 @@ export const useVrcxStore = defineStore('Vrcx', () => {
maxTableSize,
showConsole,
clearVRCXCache,
startupLaunchCommand,
eventVrcxMessage,
eventLaunchCommand,
showRegistryBackupDialog,
checkAutoBackupRestoreVrcRegistry,
tryAutoBackupVrcRegistry,

View File

@@ -62,6 +62,9 @@ declare global {
menuButton: bool,
overlayHand: int
) => Promise<void>;
ipcRenderer: {
on(channel: String, func: (...args: unknown[]) => void)
};
};
__APP_GLOBALS__: AppGlobals;
}