Skip to content

Commit

Permalink
fix: ws broadcast
Browse files Browse the repository at this point in the history
  • Loading branch information
stagas committed Oct 7, 2024
1 parent 2585356 commit 66ad7c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/ws/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { RouteError, Router } from '~/api/core/router.ts'
const clients = new Set<WebSocket>()

const bus = createBus(['ws'])
bus.onmessage = event => broadcast(null, event)
bus.onmessage = event => sendToLocalClients(null, event.data)

function broadcast(ws: WebSocket | null, { data }: { data: string }) {
bus.postMessage(data)
Expand Down

0 comments on commit 66ad7c7

Please sign in to comment.