Set pad ID only on connect (to avoid setting it twice in some cases)

pull/54/merge
Candid Dauth 2016-10-31 15:09:29 +03:00
rodzic 1358ecfad4
commit 9ceb14f485
1 zmienionych plików z 3 dodań i 7 usunięć

Wyświetl plik

@ -157,7 +157,7 @@
fmSocket.views = { };
},
reconnect: function() {
connect: function() {
if(fmSocket.padId)
setPadId(fmSocket.padId);
else
@ -171,12 +171,8 @@
for(var i in handlers)
fmSocket.on(i, handlers[i]);
if(padId) {
// Run with delay, so that loadStart event handler can register before
fmSocket.$applyAsync(function() {
fmSocket.setPadId(padId);
});
}
if(padId)
fmSocket.padId = padId;
fmSocket.$on("$destroy", function() {
socket.removeAllListeners();