mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-17 13:53:52 +02:00
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:
@@ -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,
|
||||
|
||||
3
src/types/globals.d.ts
vendored
3
src/types/globals.d.ts
vendored
@@ -62,6 +62,9 @@ declare global {
|
||||
menuButton: bool,
|
||||
overlayHand: int
|
||||
) => Promise<void>;
|
||||
ipcRenderer: {
|
||||
on(channel: String, func: (...args: unknown[]) => void)
|
||||
};
|
||||
};
|
||||
__APP_GLOBALS__: AppGlobals;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user