Prevent autoconnect from connecting twice
once from the watcher, once from the autoconnect call. -> remove the autoconnect call, it is not needed
This commit is contained in:
parent
fcc4d8a888
commit
88424279c7
1 changed files with 3 additions and 5 deletions
|
@ -815,6 +815,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
|||
|
||||
$scope.activeBuffer = models.getActiveBuffer;
|
||||
|
||||
$rootScope.connected = false;
|
||||
$rootScope.waseverconnected = false;
|
||||
|
||||
$rootScope.models = models;
|
||||
|
@ -898,8 +899,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();
|
||||
}
|
||||
});
|
||||
|
@ -1283,10 +1285,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