mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 15:08:40 +00:00
remove the connected call upon an update to reduce the number of ajax calls
This commit is contained in:
parent
3179ff2060
commit
d411f90a67
2 changed files with 158 additions and 166 deletions
|
@ -95,16 +95,6 @@ Deluge.UI = {
|
||||||
scope: this
|
scope: this
|
||||||
});
|
});
|
||||||
Deluge.Details.update();
|
Deluge.Details.update();
|
||||||
Deluge.Client.web.connected({
|
|
||||||
success: this.onConnectedCheck,
|
|
||||||
scope: this
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
onConnectedCheck: function(connected) {
|
|
||||||
if (!connected) {
|
|
||||||
Deluge.Events.fire('disconnect');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onUpdateError: function(error) {
|
onUpdateError: function(error) {
|
||||||
|
@ -125,6 +115,7 @@ Deluge.UI = {
|
||||||
* Updates the various components in the interface.
|
* Updates the various components in the interface.
|
||||||
*/
|
*/
|
||||||
onUpdate: function(data) {
|
onUpdate: function(data) {
|
||||||
|
if (!data['connected']) Deluge.Events.fire('disconnect');
|
||||||
Deluge.Torrents.update(data['torrents']);
|
Deluge.Torrents.update(data['torrents']);
|
||||||
Deluge.Statusbar.update(data['stats']);
|
Deluge.Statusbar.update(data['stats']);
|
||||||
Deluge.Sidebar.update(data['filters']);
|
Deluge.Sidebar.update(data['filters']);
|
||||||
|
@ -179,7 +170,7 @@ Deluge.UI = {
|
||||||
|
|
||||||
// Enable the plugin
|
// Enable the plugin
|
||||||
Deluge.Plugins[options.pluginName].enable();
|
Deluge.Plugins[options.pluginName].enable();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @static
|
* @static
|
||||||
|
@ -189,7 +180,7 @@ Deluge.UI = {
|
||||||
if (this.running) {
|
if (this.running) {
|
||||||
clearInterval(this.running);
|
clearInterval(this.running);
|
||||||
this.running = false;
|
this.running = false;
|
||||||
Deluge.Torrents.getStore().loadData([]);
|
Deluge.Torrents.getStore().removeAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -457,6 +457,7 @@ class WebApi(JSONComponent):
|
||||||
"""
|
"""
|
||||||
d = Deferred()
|
d = Deferred()
|
||||||
ui_info = {
|
ui_info = {
|
||||||
|
"connected": client.connected(),
|
||||||
"torrents": None,
|
"torrents": None,
|
||||||
"filters": None,
|
"filters": None,
|
||||||
"stats": {
|
"stats": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue