Style the reconnect banner, clean up apply usage

This commit is contained in:
Tor Hveem 2015-03-14 21:10:19 +01:00
commit 7029511029
4 changed files with 13 additions and 8 deletions

View file

@ -184,10 +184,10 @@ weechat.factory('connection',
$log.info('Attempting to reconnect...');
var d = connectionData;
connect(d[0], d[1], d[2], d[3], d[4], function() {
$rootScope.reconnecting = false;
// on success, update active buffer
models.setActiveBuffer(bufferId);
$log.info('Sucessfully reconnected to relay');
$rootScope.reconnecting = false;
}, function() {
// on failure, schedule another attempt
if (timeout >= 600000) {
@ -217,6 +217,8 @@ weechat.factory('connection',
}
$rootScope.reconnecting = true;
// Have to do this to get the reconnect banner to show
$rootScope.$apply();
var bufferId = models.getActiveBuffer().id,
timeout = 3000; // start with a three-second timeout

View file

@ -110,7 +110,6 @@ function($rootScope, $q) {
$rootScope.$emit('onMessage', message);
}
$rootScope.$apply();
};
var connect = function(url,