From 759e3fedf4cd6573cd26e87370eb4a89e1e844ed Mon Sep 17 00:00:00 2001 From: sadan <117494111+sadan4@users.noreply.github.com> Date: Tue, 7 Jan 2025 01:47:01 -0500 Subject: [PATCH] fix minor issue --- .vscode/settings.json | 4 ++-- src/plugins/devCompanion.dev/initWs.tsx | 13 ++++++++----- src/plugins/devCompanion.dev/types/send.ts | 1 + 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index fa543b38c..9eece6b7d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,11 +13,11 @@ "typescript.format.semicolons": "insert", "typescript.preferences.quoteStyle": "double", "javascript.preferences.quoteStyle": "double", - "gitlens.remotes": [ { "domain": "codeberg.org", "type": "Gitea" } - ] + ], + "vencord-companion.showSidebar": true, } diff --git a/src/plugins/devCompanion.dev/initWs.tsx b/src/plugins/devCompanion.dev/initWs.tsx index 0edb67086..7e4797e04 100644 --- a/src/plugins/devCompanion.dev/initWs.tsx +++ b/src/plugins/devCompanion.dev/initWs.tsx @@ -134,7 +134,7 @@ export function initWs(isManual = false) { nonce: d.nonce }; // data.nonce = d.nonce; - ws.send(JSON.stringify(data)); + ws.send(JSON.stringify(toSend)); } logger.info("Received Message:", d.type, "\n", d.data); @@ -412,17 +412,20 @@ export function initWs(isManual = false) { .then(() => { resolve(); replyData({ - type: "allModules", - data: Object.keys(wreq.m), + type: "moduleList", + data: { + modules: Object.keys(wreq.m) + }, ok: true }); }) .catch(e => { console.error(e); replyData({ - type: "allModules", + type: "moduleList", ok: false, - data: e.toString() + error: String(e), + data: null }); reject(e); }); diff --git a/src/plugins/devCompanion.dev/types/send.ts b/src/plugins/devCompanion.dev/types/send.ts index 713bf9d13..870189b11 100644 --- a/src/plugins/devCompanion.dev/types/send.ts +++ b/src/plugins/devCompanion.dev/types/send.ts @@ -15,6 +15,7 @@ export type Base = { ok: true; } | { ok: false; + data?: any; error: string; }; export type Nonce = {