From 40b807efc8d52684f7eef18b93b0257c60825ace Mon Sep 17 00:00:00 2001 From: NigeParis Date: Mon, 24 Nov 2025 18:03:21 +0100 Subject: [PATCH] Connected Button Added now working --- src/chat/src/app.ts | 7 ++++--- src/chat/src/routes/nginx-chat.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/chat/src/app.ts b/src/chat/src/app.ts index bf3ff97..4749bb9 100644 --- a/src/chat/src/app.ts +++ b/src/chat/src/app.ts @@ -10,7 +10,8 @@ import { Server, Socket } from 'socket.io'; declare const __SERVICE_NAME: string; // Global map of clients -const clientChat = new Map(); // key = client name, value = socket +// key = socket, value = clientname +const clientChat = new Map(); // @ts-expect-error: import.meta.glob is a vite thing. Typescript doesn't know this... const plugins = import.meta.glob('./plugins/**/*.ts', { eager: true }); @@ -110,8 +111,8 @@ async function onReady(fastify: FastifyInstance) { // console.log(color.green,"count: ", count); console.log(color.yellow, 'Client:', color.reset, username); - const targetSocketId: any = target; - io.to(targetSocketId).emit('listObj', username); + const targetSocketId = target; + io.to(targetSocketId!).emit('listObj', username); console.log( color.yellow, diff --git a/src/chat/src/routes/nginx-chat.ts b/src/chat/src/routes/nginx-chat.ts index 1358728..d3aaebb 100644 --- a/src/chat/src/routes/nginx-chat.ts +++ b/src/chat/src/routes/nginx-chat.ts @@ -23,7 +23,7 @@ const route: FastifyPluginAsync = async (fastify): Promise => { config: { requireAuth: true }, }, async (req, res) => { - //console.log('/api/chat/test called =================>'); + // console.log('/api/chat/test called =================>'); res.makeResponse(200, 'success', 'CCChat.success', { name: 'My_namw', 'id': req.authUser!.id, guest: false }); }, );