From 80bbd9dbf3b4008d0e8168dc00265ef1edca8f41 Mon Sep 17 00:00:00 2001 From: Anthony Dresser Date: Wed, 7 Mar 2018 11:57:08 -0800 Subject: [PATCH] update insight last update time on refresh (#841) --- .../dashboard/widgets/insights/insightsWidget.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sql/parts/dashboard/widgets/insights/insightsWidget.component.ts b/src/sql/parts/dashboard/widgets/insights/insightsWidget.component.ts index ba1ae91aef..879c620bb1 100644 --- a/src/sql/parts/dashboard/widgets/insights/insightsWidget.component.ts +++ b/src/sql/parts/dashboard/widgets/insights/insightsWidget.component.ts @@ -130,10 +130,13 @@ export class InsightsWidget extends DashboardWidget implements IDashboardWidget, private _storeResult(result: SimpleExecuteResult): SimpleExecuteResult { if (this.insightConfig.cacheId) { + let currentTime = new Date(); let store: IStorageResult = { - date: new Date().toString(), + date: currentTime.toString(), results: result }; + this.lastUpdated = nls.localize('insights.lastUpdated', "Last Updated: {0} {1}", currentTime.toLocaleTimeString(), currentTime.toLocaleDateString()); + this._cd.detectChanges(); this.dashboardService.storageService.store(this._getStorageKey(), JSON.stringify(store)); } return result;