Skip to content

Commit

Permalink
fix: temporarily handle sending messages that dont have modules
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Jun 6, 2024
1 parent 221375e commit f1f6407
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,12 @@ class SocketServer extends EventEmitter {
if (authorized.authorized)
data = authorized.authorized

// TODO: handle non module cases where send is required from messages
let moduleName = data.method.split('.')[0]
if (['storage', 'database', 'array', 'index', 'object'].includes(moduleName))
this.emit(data.method, data);
else if (data.method === 'crdt' || data.method === 'cursor')
this.send(data);
else
this.emit(moduleName, data);
}
Expand Down

0 comments on commit f1f6407

Please sign in to comment.