update insight last update time on refresh (#841)

This commit is contained in:
Anthony Dresser
2018-03-07 11:57:08 -08:00
committed by GitHub
parent c019175fff
commit 80bbd9dbf3

View File

@@ -130,10 +130,13 @@ export class InsightsWidget extends DashboardWidget implements IDashboardWidget,
private _storeResult(result: SimpleExecuteResult): SimpleExecuteResult { private _storeResult(result: SimpleExecuteResult): SimpleExecuteResult {
if (this.insightConfig.cacheId) { if (this.insightConfig.cacheId) {
let currentTime = new Date();
let store: IStorageResult = { let store: IStorageResult = {
date: new Date().toString(), date: currentTime.toString(),
results: result 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)); this.dashboardService.storageService.store(this._getStorageKey(), JSON.stringify(store));
} }
return result; return result;