From 35862b94a981552fc7e6046cf0c53c2b02427521 Mon Sep 17 00:00:00 2001 From: Ashesh Vashi Date: Thu, 26 Jul 2018 22:44:31 +0530 Subject: [PATCH] We need to remove the interval callbacks for retrieving the statistics for the charts on dashboard every time the URL changed (not - just when connection to the server was alive). --- web/pgadmin/dashboard/static/js/dashboard.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/pgadmin/dashboard/static/js/dashboard.js b/web/pgadmin/dashboard/static/js/dashboard.js index 09d885d78..5e4b1b1a1 100644 --- a/web/pgadmin/dashboard/static/js/dashboard.js +++ b/web/pgadmin/dashboard/static/js/dashboard.js @@ -301,15 +301,16 @@ define('pgadmin.dashboard', [ ); if (div) { + + /* Clear all the interval functions of previous dashboards */ + self.clearIntervalId(); + if (itemData.connected || _.isUndefined(itemData.connected)) { // Avoid unnecessary reloads if (url !== $(dashboardPanel).data('dashboard_url') || ( url === $(dashboardPanel).data('dashboard_url') && $(dashboardPanel).data('server_status') == false)) { $(div).empty(); - /* Clear all the interval functions of previous dashboards */ - self.clearIntervalId(); - $.ajax({ url: url,