Fix race condition
parent
48dc8c78b4
commit
78ff55e34e
www/common
|
@ -858,6 +858,7 @@ define([
|
|||
});
|
||||
|
||||
postMessage = function (cmd, data, cb) {
|
||||
cb = cb || function () {}
|
||||
chan.query(cmd, data, function (err, data) {
|
||||
if (err) { return void cb ({error: err}); }
|
||||
cb(data);
|
||||
|
|
|
@ -981,6 +981,11 @@ define([
|
|||
}
|
||||
|
||||
if (!isNew && channel.wc) {
|
||||
postMessage(clientId, "PAD_CONNECT", {
|
||||
myID: channel.wc.myID,
|
||||
id: channel.wc.id,
|
||||
members: channel.wc.members
|
||||
});
|
||||
channel.wc.members.forEach(function (m) {
|
||||
postMessage(clientId, "PAD_JOIN", m);
|
||||
});
|
||||
|
@ -992,11 +997,6 @@ define([
|
|||
});
|
||||
});
|
||||
postMessage(clientId, "PAD_READY");
|
||||
cb({
|
||||
myID: channel.wc.myID,
|
||||
id: channel.wc.id,
|
||||
members: channel.wc.members
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue