Commit 86a0fa28 authored by JC Brand's avatar JC Brand

Call `clearSession` when disconnecting

So that the chatboxes get closed/removed.

Also, don't render the login form when we're just reconnecting.
parent 38bfbbf6
...@@ -63220,10 +63220,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -63220,10 +63220,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
view.model.set({ view.model.set({
'connected': false 'connected': false
}); });
view.renderLoginPanel(); return view;
}; };
_converse.on('disconnected', disconnect); _converse.on('disconnected', () => disconnect().renderLoginPanel());
_converse.on('will-reconnect', disconnect); _converse.on('will-reconnect', disconnect);
} }
...@@ -63760,6 +63760,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -63760,6 +63760,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
_converse.tearDown(); _converse.tearDown();
_converse.clearSession();
_converse.emit('disconnected'); _converse.emit('disconnected');
}; };
...@@ -613,9 +613,9 @@ ...@@ -613,9 +613,9 @@
*/ */
const view = _converse.chatboxviews.get('controlbox'); const view = _converse.chatboxviews.get('controlbox');
view.model.set({'connected': false}); view.model.set({'connected': false});
view.renderLoginPanel(); return view;
}; };
_converse.on('disconnected', disconnect); _converse.on('disconnected', () => disconnect().renderLoginPanel());
_converse.on('will-reconnect', disconnect); _converse.on('will-reconnect', disconnect);
} }
}); });
......
...@@ -526,6 +526,7 @@ ...@@ -526,6 +526,7 @@
delete _converse.connection.reconnecting; delete _converse.connection.reconnecting;
_converse.connection.reset(); _converse.connection.reset();
_converse.tearDown(); _converse.tearDown();
_converse.clearSession();
_converse.emit('disconnected'); _converse.emit('disconnected');
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment