Merge pull request #382 from glowing-bear/fixautoconnect
Prevent autoconnect from connecting twice
This commit is contained in:
commit
12a8726407
1 changed files with 3 additions and 5 deletions
|
@ -831,6 +831,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
|||
|
||||
$scope.activeBuffer = models.getActiveBuffer;
|
||||
|
||||
$rootScope.connected = false;
|
||||
$rootScope.waseverconnected = false;
|
||||
|
||||
$rootScope.models = models;
|
||||
|
@ -914,8 +915,9 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
|||
document.getElementById('content').setAttribute('sidebar-state', 'hidden');
|
||||
}
|
||||
};
|
||||
// This also fires on page load
|
||||
$scope.$watch('autoconnect', function() {
|
||||
if ($scope.autoconnect && !$rootScope.connected) {
|
||||
if ($scope.autoconnect && !$rootScope.connected && !$rootScope.sslError && !$rootScope.securityError && !$rootScope.errorMessage) {
|
||||
$scope.connect();
|
||||
}
|
||||
});
|
||||
|
@ -1299,10 +1301,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
|||
$scope.favico.reset();
|
||||
};
|
||||
|
||||
if ($scope.autoconnect && !$rootScope.connected && !$rootScope.sslError && !$rootScope.securityError && !$rootScope.errorMessage) {
|
||||
$scope.connect();
|
||||
}
|
||||
|
||||
}]
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue