fix some bug

This commit is contained in:
kirigaya 2025-05-25 23:04:41 +08:00
parent 13d05462fe
commit f0b8b88fbc
2 changed files with 9 additions and 5 deletions

View File

@ -30,6 +30,7 @@ export async function routeMessage(command: string, data: any, webview: PostMess
webview.postMessage({ command, data: res });
}
} catch (error) {
console.error(error);
webview.postMessage({
command, data: {
code: 500,

View File

@ -249,12 +249,15 @@ export async function connectService(
const uuid = await deterministicUUID(JSON.stringify(option));
const reuseConntion = clientMap.has(uuid);
if (!clientMap.has(uuid)) {
const client = await connect(option);
clientMap.set(uuid, client);
}
// if (!clientMap.has(uuid)) {
// const client = await connect(option);
// clientMap.set(uuid, client);
// }
// const client = clientMap.get(uuid)!;
const client = clientMap.get(uuid)!;
const client = await connect(option);
clientMap.set(uuid, client);
const versionInfo = client.getServerVersion();