When closing the window, disconnect instead of asking the user to do it
This commit is contained in:
parent
4f23eb7334
commit
24f63be25c
1 changed files with 1 additions and 3 deletions
|
@ -612,9 +612,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
||||||
// Prevent user from accidentally leaving the page
|
// Prevent user from accidentally leaving the page
|
||||||
window.onbeforeunload = function(event) {
|
window.onbeforeunload = function(event) {
|
||||||
if ($rootScope.connected) {
|
if ($rootScope.connected) {
|
||||||
event.preventDefault();
|
$scope.disconnect();
|
||||||
// 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.";
|
|
||||||
}
|
}
|
||||||
$rootScope.favico.reset();
|
$rootScope.favico.reset();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue