From 24f63be25c2148201899fba7fd9fb6ffec3bb7a6 Mon Sep 17 00:00:00 2001 From: David Cormier Date: Sun, 31 Aug 2014 09:59:10 -0400 Subject: [PATCH] When closing the window, disconnect instead of asking the user to do it --- js/glowingbear.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index ec8fbb1..161b9e2 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -612,9 +612,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', // Prevent user from accidentally leaving the page window.onbeforeunload = function(event) { if ($rootScope.connected) { - event.preventDefault(); - // Chrome requires us to set this or it will not show the dialog - event.returnValue = "You have an active connection to your WeeChat relay. Please disconnect using the button in the top-right corner or by double-tapping the Escape key."; + $scope.disconnect(); } $rootScope.favico.reset(); };