From c4fe73398e6c0a372097c0b9a146e9ac8105e1ff Mon Sep 17 00:00:00 2001 From: Aaron Greenspan Date: Mon, 7 Dec 2020 16:27:57 -0700 Subject: [PATCH] head end timing for loadInstalledApp --- ui/src/app/models/model-preload.ts | 3 ++- ui/src/app/pages/apps-routes/app-config/app-config.page.ts | 2 +- ui/src/app/services/api/live-api.service.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ui/src/app/models/model-preload.ts b/ui/src/app/models/model-preload.ts index ac1775933..4ce27508f 100644 --- a/ui/src/app/models/model-preload.ts +++ b/ui/src/app/models/model-preload.ts @@ -50,8 +50,9 @@ export class ModelPreload { } loadInstalledApp (appId: string): Promise> { + const now = new Date() return this.api.getInstalledApp(appId).then(res => { - this.appModel.update({ id: appId, ...res, hasFetchedFull: true }) + this.appModel.update({ id: appId, ...res, hasFetchedFull: true }, now) return this.appModel.watch(appId) }) } diff --git a/ui/src/app/pages/apps-routes/app-config/app-config.page.ts b/ui/src/app/pages/apps-routes/app-config/app-config.page.ts index 90e800c36..3fdb1aa72 100644 --- a/ui/src/app/pages/apps-routes/app-config/app-config.page.ts +++ b/ui/src/app/pages/apps-routes/app-config/app-config.page.ts @@ -205,7 +205,7 @@ export class AppConfigPage extends Cleanup { } return this.apiService.patchAppConfig(app, config).then( - () => this.preload.loadInstalledApp(this.appId).then(() => ({ skip: false})), + () => this.preload.loadInstalledApp(this.appId).then(() => ({ skip: false })), ) }) .then(({ skip }) => { diff --git a/ui/src/app/services/api/live-api.service.ts b/ui/src/app/services/api/live-api.service.ts index eeec15c75..1e54ee770 100644 --- a/ui/src/app/services/api/live-api.service.ts +++ b/ui/src/app/services/api/live-api.service.ts @@ -255,4 +255,5 @@ type HttpError = HttpErrorResponse & { error: { code: string, message: string } const dryRunParam = (dryRun: boolean, first: boolean) => { if (!dryRun) return '' return first ? `?dryrun` : `&dryrun` -} \ No newline at end of file +} +