From ad7b09b43323d0ffc0a8ddabb43e4838a184c697 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 24 Feb 2026 13:18:42 -0800 Subject: formatting --- lib/sockets.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'lib/sockets.ts') diff --git a/lib/sockets.ts b/lib/sockets.ts index 2e1c98e9..88817728 100644 --- a/lib/sockets.ts +++ b/lib/sockets.ts @@ -120,12 +120,8 @@ Bun.serve({ await track(ws, data); } catch (e) { - if (e.message.includes("not found")) - ws.send(JSON.stringify({ type: "logout" })); - setTimeout( - () => ws?.close(code, `closing due to error ${e.message}`), - 1000, - ); + if (e.message.includes("not found")) ws.send(JSON.stringify({ type: "logout" })); + setTimeout(() => ws?.close(code, `closing due to error ${e.message}`), 1000); } break; case "token": @@ -139,7 +135,7 @@ Bun.serve({ subscriptions.push({ invoice: data, ws }); break; default: - // warn("received socket message of unknown type", type, data); + // warn("received socket message of unknown type", type, data); } }, open(ws: any) { @@ -158,8 +154,7 @@ Bun.serve({ } let i; - ~(i = subscriptions.findIndex((s) => s.ws.id === id)) && - subscriptions.splice(i, 1); + ~(i = subscriptions.findIndex((s) => s.ws.id === id)) && subscriptions.splice(i, 1); if (all[id]) delete all[id]; } catch (e) { -- cgit v1.2.3