mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
[#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:
parent
587b9afefe
commit
de1e7c27df
1 changed files with 12 additions and 3 deletions
|
@ -229,15 +229,24 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
|
||||||
var selected = this.list.getSelectedRecords()[0];
|
var selected = this.list.getSelectedRecords()[0];
|
||||||
if (!selected) return;
|
if (!selected) return;
|
||||||
|
|
||||||
if (selected.get('status').toLowerCase() == 'connected') {
|
var me = this;
|
||||||
|
var disconnect = function() {
|
||||||
deluge.client.web.disconnect({
|
deluge.client.web.disconnect({
|
||||||
success: function(result) {
|
success: function(result) {
|
||||||
this.update(this);
|
this.update(this);
|
||||||
deluge.events.fire('disconnect');
|
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;
|
var id = selected.id;
|
||||||
deluge.client.web.connect(id, {
|
deluge.client.web.connect(id, {
|
||||||
success: function(methods) {
|
success: function(methods) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue