From: ResidentBiscuit Date: Wed, 10 Dec 2014 20:13:41 +0000 (-0600) Subject: Only close final connection if user meant to X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=09e38d19767b034ef464a6514e624e2abe3498ec;p=KiwiIRC.git Only close final connection if user meant to --- diff --git a/client/src/views/tabs.js b/client/src/views/tabs.js index 23efb7f..0c9f60e 100644 --- a/client/src/views/tabs.js +++ b/client/src/views/tabs.js @@ -134,10 +134,16 @@ _kiwi.view.Tabs = Backbone.View.extend({ 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); + if(_kiwi.app.connections.length < 2) { + var confirmed = confirm("Closing your final connection will redirect you back to the homepage. Is this OK?"); + if(confirmed) { + this.model.network.gateway.quit("Leaving"); + _kiwi.app.connections.remove(this.model.network); + window.location.reload(true); + } + } else { + this.model.network.gateway.quit("Leaving"); + _kiwi.app.connections.remove(this.model.network); } } else { panel.close();