[#2867][WebUI] Fix Daemon connection problem

Trying to connect to daemon B while still connected to A will cause
the torrents from A to be shown after connecting to B.
Therefor, checking if connected to any daemon before connecting to B.
This commit is contained in:
DjLegolas 2018-06-18 08:41:33 +03:00 committed by Calum Lind
parent 587b9afefe
commit de1e7c27df
1 changed files with 12 additions and 3 deletions

View File

@ -229,15 +229,24 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
var selected = this.list.getSelectedRecords()[0];
if (!selected) return;
if (selected.get('status').toLowerCase() == 'connected') {
var me = this;
var disconnect = function() {
deluge.client.web.disconnect({
success: function(result) {
this.update(this);
deluge.events.fire('disconnect');
},
scope: this
scope: me
});
} else {
};
if (selected.get('status').toLowerCase() == 'connected') {
disconnect();
} else {
if (this.list.getStore().find('status', 'Connected', 0, false, false) > -1) {
disconnect();
}
var id = selected.id;
deluge.client.web.connect(id, {
success: function(methods) {