Connected Button Added now working
This commit is contained in:
parent
deaf58dfce
commit
40b807efc8
2 changed files with 5 additions and 4 deletions
|
|
@ -10,7 +10,8 @@ import { Server, Socket } from 'socket.io';
|
|||
declare const __SERVICE_NAME: string;
|
||||
|
||||
// Global map of clients
|
||||
const clientChat = new Map<string, string>(); // key = client name, value = socket
|
||||
// key = socket, value = clientname
|
||||
const clientChat = new Map<string, string>();
|
||||
|
||||
// @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,
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ const route: FastifyPluginAsync = async (fastify): Promise<void> => {
|
|||
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 });
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue