handle socketio reconnect situation
This commit is contained in:
parent
64283850e3
commit
5ad1504494
2 changed files with 11 additions and 2 deletions
|
@ -1918,6 +1918,7 @@ Metamaps.Realtime = {
|
||||||
webrtc: null,
|
webrtc: null,
|
||||||
readyToCall: false,
|
readyToCall: false,
|
||||||
mappersOnMap: {},
|
mappersOnMap: {},
|
||||||
|
disconnected: false,
|
||||||
chatOpen: false,
|
chatOpen: false,
|
||||||
status: true, // stores whether realtime is True/On or False/Off,
|
status: true, // stores whether realtime is True/On or False/Off,
|
||||||
broadcastingStatus: false,
|
broadcastingStatus: false,
|
||||||
|
@ -1943,7 +1944,12 @@ Metamaps.Realtime = {
|
||||||
self.socket = new SocketIoConnection({ url: whichToConnect });
|
self.socket = new SocketIoConnection({ url: whichToConnect });
|
||||||
self.socket.on('connect', function () {
|
self.socket.on('connect', function () {
|
||||||
console.log('connected');
|
console.log('connected');
|
||||||
|
if (!self.disconnected) {
|
||||||
self.startActiveMap();
|
self.startActiveMap();
|
||||||
|
} else self.disconnected = false;
|
||||||
|
});
|
||||||
|
self.socket.on('disconnect', function () {
|
||||||
|
self.disconnected = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Metamaps.Active.Mapper) {
|
if (Metamaps.Active.Mapper) {
|
||||||
|
@ -2171,7 +2177,7 @@ Metamaps.Realtime = {
|
||||||
var self = Metamaps.Realtime;
|
var self = Metamaps.Realtime;
|
||||||
|
|
||||||
self.webrtc.off('readyToCall');
|
self.webrtc.off('readyToCall');
|
||||||
self.webrtc.on('readyToCall', function () {
|
self.webrtc.once('readyToCall', function () {
|
||||||
self.videoInitialized = true;
|
self.videoInitialized = true;
|
||||||
self.readyToCall = true;
|
self.readyToCall = true;
|
||||||
self.localVideo.view.$container.show();
|
self.localVideo.view.$container.show();
|
||||||
|
|
|
@ -110,6 +110,9 @@
|
||||||
background: url(<%= asset_path 'junto.png' %>) no-repeat 2px 9px, url(<%= asset_path 'tray_tab.png' %>) no-repeat;
|
background: url(<%= asset_path 'junto.png' %>) no-repeat 2px 9px, url(<%= asset_path 'tray_tab.png' %>) no-repeat;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
.chat-box .chat-button.active {
|
||||||
|
background: url(<%= asset_path 'junto.gif' %>) no-repeat 2px 9px, url(<%= asset_path 'tray_tab.png' %>) no-repeat !important;
|
||||||
|
}
|
||||||
.chat-box .chat-button .chat-unread {
|
.chat-box .chat-button .chat-unread {
|
||||||
display: none;
|
display: none;
|
||||||
background: #DAB539;
|
background: #DAB539;
|
||||||
|
|
Loading…
Reference in a new issue