Fix race condition in chat
This commit is contained in:
parent
7406d081aa
commit
8cd7327d20
1 changed files with 5 additions and 2 deletions
|
@ -141,8 +141,11 @@
|
|||
message: message,
|
||||
},
|
||||
success: function (data) {
|
||||
add_message(data);
|
||||
callback(true);
|
||||
// make sure user is still in the same room
|
||||
if (room == window.room_id) {
|
||||
add_message(data);
|
||||
callback(true);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
console.log('Could not add new message');
|
||||
|
|
Loading…
Reference in a new issue