Skip to content

Commit

Permalink
fix: sync console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Nov 10, 2023
1 parent 7a4a603 commit b49bb6a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,14 +416,17 @@ class SocketServer extends EventEmitter {
return

for (let i = 0; i < data.object.length; i++) {
data.object[i].data._id = data.object[i]._id
data.object[i].data.sync = true
if (data.object[i].data) {
data.object[i].data._id = data.object[i]._id
data.object[i].data.sync = true

const authorized = await this.authorize.check(data.object[i].data, socket.user_id)
if (authorized && authorized.authorized)
socket.send(JSON.stringify(authorized.authorized));
else
socket.send(JSON.stringify(data.object[i].data));
const authorized = await this.authorize.check(data.object[i].data, socket.user_id)
if (authorized && authorized.authorized)
socket.send(JSON.stringify(authorized.authorized));
else
socket.send(JSON.stringify(data.object[i].data));
} else
console.log('server sync missing data')
}
} else {
const sent = []
Expand Down

0 comments on commit b49bb6a

Please sign in to comment.