diff options
| author | Adam Soltys <[email protected]> | 2026-02-24 13:18:42 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-24 13:18:42 -0800 |
| commit | ad7b09b43323d0ffc0a8ddabb43e4838a184c697 (patch) | |
| tree | fbf2a59f81771b2938f474c8e7b35a497d2960e4 /lib/sockets.ts | |
| parent | 9e97e040617bfa0b40150c0eba298bf186bbeeaf (diff) | |
| download | coinos-server-ad7b09b43323d0ffc0a8ddabb43e4838a184c697.tar.gz coinos-server-ad7b09b43323d0ffc0a8ddabb43e4838a184c697.zip | |
formatting
Diffstat (limited to 'lib/sockets.ts')
| -rw-r--r-- | lib/sockets.ts | 13 |
1 files changed, 4 insertions, 9 deletions
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) { |
