mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 06:58:42 +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
|
||||
});
|
||||
Deluge.Details.update();
|
||||
Deluge.Client.web.connected({
|
||||
success: this.onConnectedCheck,
|
||||
scope: this
|
||||
});
|
||||
},
|
||||
|
||||
onConnectedCheck: function(connected) {
|
||||
if (!connected) {
|
||||
Deluge.Events.fire('disconnect');
|
||||
}
|
||||
},
|
||||
|
||||
onUpdateError: function(error) {
|
||||
|
@ -125,6 +115,7 @@ Deluge.UI = {
|
|||
* Updates the various components in the interface.
|
||||
*/
|
||||
onUpdate: function(data) {
|
||||
if (!data['connected']) Deluge.Events.fire('disconnect');
|
||||
Deluge.Torrents.update(data['torrents']);
|
||||
Deluge.Statusbar.update(data['stats']);
|
||||
Deluge.Sidebar.update(data['filters']);
|
||||
|
@ -189,7 +180,7 @@ Deluge.UI = {
|
|||
if (this.running) {
|
||||
clearInterval(this.running);
|
||||
this.running = false;
|
||||
Deluge.Torrents.getStore().loadData([]);
|
||||
Deluge.Torrents.getStore().removeAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -457,6 +457,7 @@ class WebApi(JSONComponent):
|
|||
"""
|
||||
d = Deferred()
|
||||
ui_info = {
|
||||
"connected": client.connected(),
|
||||
"torrents": None,
|
||||
"filters": None,
|
||||
"stats": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue