feat(rpc): implement arrpc's link event (#1016)

Co-authored-by: Vendicated <vendicated@riseup.net>
This commit is contained in:
Cookie
2025-02-05 14:00:40 -05:00
committed by GitHub
parent c9be618164
commit 56442ae1e9
6 changed files with 45 additions and 7 deletions

View File

@@ -4,7 +4,7 @@
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import { onceReady } from "@vencord/types/webpack";
import { findLazy, onceReady } from "@vencord/types/webpack";
import { FluxDispatcher, InviteActions } from "@vencord/types/webpack/common";
import { IpcCommands } from "shared/IpcEvents";
@@ -38,3 +38,15 @@ onIpcCommand(IpcCommands.RPC_INVITE, async code => {
return true;
});
const { DEEP_LINK } = findLazy(m => m.DEEP_LINK?.handler);
onIpcCommand(IpcCommands.RPC_DEEP_LINK, async data => {
try {
DEEP_LINK.handler({ args: data });
return true;
} catch (err) {
console.error("[RPC]", "Failed to open deep link:", err, data);
return false;
}
});