Merge pull request #169 from cormier/fix-73
Reinitialize context when relay closes connection
This commit is contained in:
commit
e468fe57f0
|
@ -378,6 +378,7 @@ function($rootScope,
|
|||
$log.info("Disconnected from relay");
|
||||
failCallbacks('disconnection');
|
||||
$rootScope.connected = false;
|
||||
$rootScope.$emit('relayDisconnect');
|
||||
$rootScope.$apply();
|
||||
};
|
||||
|
||||
|
@ -584,6 +585,11 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
|||
$scope.showSidebar = true;
|
||||
|
||||
$scope.buffers = models.model.buffers;
|
||||
|
||||
$rootScope.$on('relayDisconnect', function() {
|
||||
models.reinitialize();
|
||||
});
|
||||
|
||||
$scope.activeBuffer = models.getActiveBuffer;
|
||||
|
||||
$rootScope.waseverconnected = false;
|
||||
|
|
|
@ -425,6 +425,14 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
|||
return BufferList;
|
||||
};
|
||||
|
||||
/*
|
||||
* Reinitializes the model
|
||||
*/
|
||||
this.reinitialize = function() {
|
||||
BufferList = [];
|
||||
this.model.buffers = {};
|
||||
};
|
||||
|
||||
/*
|
||||
* Returns a specific buffer object
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue