Permalink
Browse files

Root master takeover

  • Loading branch information...
1 parent 125f79b commit 30b7049790bbfe8b58e8d99593ea86c280f330a8 @tonistiigi committed Mar 25, 2012
Showing with 8 additions and 1 deletion.
  1. +2 −1 lib/backend/server.js
  2. +6 −0 lib/public/js/app_master.js
View
@@ -64,8 +64,9 @@ var channels = {};
app.get('/:name/reset/'+CONF.root, function(req, res, next){
if(channels[req.params.name]){
- unset(channels[req.params.name]);
+ if(channels[req.params.name].socket)
channels[req.params.name].socket.disconnect();
+ delete channels[req.params.name];
return res.redirect('/' + req.params.name+'/master');
}
});
@@ -16,6 +16,12 @@ ms.socket.on('connect', function(){
ms.socket.on('loaded', function(trackId) {
ms.trigger('loaded', trackId);
});
+
+ ms.socket.on('disconnect', function(){
+ setTimeout(function(){
+ window.location.reload();
+ }, 500);
+ });
});

0 comments on commit 30b7049

Please sign in to comment.