remove the connected call upon an update to reduce the number of ajax calls

This commit is contained in:
Damien Churchill 2009-11-04 19:54:59 +00:00
commit d411f90a67
2 changed files with 158 additions and 166 deletions

View file

@ -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();
}
}
}

View file

@ -457,6 +457,7 @@ class WebApi(JSONComponent):
"""
d = Deferred()
ui_info = {
"connected": client.connected(),
"torrents": None,
"filters": None,
"stats": {