From 8a82c69419dc358fbaeab322c32d18ee84656feb Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 5 Sep 2022 21:08:53 -0700 Subject: missing imports and fastify err responses --- lib/sockets.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/sockets.js') diff --git a/lib/sockets.js b/lib/sockets.js index 8a5ef958..366820e0 100644 --- a/lib/sockets.js +++ b/lib/sockets.js @@ -1,4 +1,5 @@ import store from "./store"; +import config from "$config"; import app from "$app"; import jwt from "jsonwebtoken"; import { v4 } from "uuid"; @@ -6,6 +7,9 @@ import WebSocket from "ws"; import { differenceInSeconds, subSeconds } from "date-fns"; import fastifyWs from "@fastify/websocket"; import whitelist from "./whitelist"; +import { l, err, warn } from "$lib/logging"; +import { getUser } from "$lib/utils"; +import db from "$db"; const code = 1000; @@ -36,7 +40,7 @@ export const emit = (username, type, data) => { } if (!store.sockets[username]) return; - for (id in store.sockets[username]) { + for (let id in store.sockets[username]) { const ws = store.sockets[username][id]; ws.send(JSON.stringify({ type, data })); } -- cgit v1.2.3