Redirect client to homepage if last connection closed
authorResidentBiscuit <jared.ready1@gmail.com>
Wed, 10 Dec 2014 19:52:39 +0000 (13:52 -0600)
committerResidentBiscuit <jared.ready1@gmail.com>
Wed, 10 Dec 2014 19:52:39 +0000 (13:52 -0600)
client/src/views/tabs.js

index c2e663d0d4c3617f5afa5989956f6d3dbcf95834..23efb7ff93b505793b449b41f0fed301c86f843b 100644 (file)
@@ -130,12 +130,15 @@ _kiwi.view.Tabs = Backbone.View.extend({
 
         // If the nicklist is empty, we haven't joined the channel as yet
         // If we part a server, then we need to disconnect from server, close channel tabs,
-        // then close server tab
+        // close server tab, then bring client back to homepage
         if (panel.isChannel() && panel.get('members').models.length > 0) {
             this.model.network.gateway.part(panel.get('name'));
         } else if(panel.isServer()) {
             this.model.network.gateway.quit("Leaving");
             _kiwi.app.connections.remove(this.model.network);
+            if(_kiwi.app.connections.length < 1) {
+                window.location.reload(true);
+            }
         } else {
             panel.close();
         }