From a425e099ba6c2a4d28cac1d865113ce3adf3331d Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Mon, 7 Nov 2022 20:03:41 -0700 Subject: [PATCH 1/2] closes #1900 --- .../projects/setup-wizard/src/app/pages/home/home.page.ts | 2 +- .../refresh-alert/refresh-alert.component.html | 8 ++++++-- .../refresh-alert/refresh-alert.service.ts | 3 +-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/projects/setup-wizard/src/app/pages/home/home.page.ts b/frontend/projects/setup-wizard/src/app/pages/home/home.page.ts index 7df9d3423..bf25183a6 100644 --- a/frontend/projects/setup-wizard/src/app/pages/home/home.page.ts +++ b/frontend/projects/setup-wizard/src/app/pages/home/home.page.ts @@ -47,7 +47,7 @@ export class HomePage { } async ionViewDidEnter() { - this.loaded = true // needed to accomodate autoHight="true" on swiper. Otherwise Swiper height might be 0 when navigatging *to* this page from later page. Happens on refresh. + this.loaded = true // needed to accommodate autoHight="true" on swiper. Otherwise Swiper height might be 0 when navigating *to* this page from later page. Happens on refresh. if (this.swiper) { this.swiper.allowTouchMove = false } diff --git a/frontend/projects/ui/src/app/components/toast-container/refresh-alert/refresh-alert.component.html b/frontend/projects/ui/src/app/components/toast-container/refresh-alert/refresh-alert.component.html index fe6dd640d..0c4ec3543 100644 --- a/frontend/projects/ui/src/app/components/toast-container/refresh-alert/refresh-alert.component.html +++ b/frontend/projects/ui/src/app/components/toast-container/refresh-alert/refresh-alert.component.html @@ -1,5 +1,9 @@ - + Your user interface is cached and out of date. Hard refresh the page to get the latest UI. - Refresh Page +
    +
  • On Mac: cmd + shift + R
  • +
  • On Linux/Windows: ctrl + shift + R
  • +
+ Ok
diff --git a/frontend/projects/ui/src/app/components/toast-container/refresh-alert/refresh-alert.service.ts b/frontend/projects/ui/src/app/components/toast-container/refresh-alert/refresh-alert.service.ts index 460c00ff6..d77bbd543 100644 --- a/frontend/projects/ui/src/app/components/toast-container/refresh-alert/refresh-alert.service.ts +++ b/frontend/projects/ui/src/app/components/toast-container/refresh-alert/refresh-alert.service.ts @@ -6,11 +6,10 @@ import { PatchDB } from 'patch-db-client' import { ConfigService } from '../../../services/config.service' import { DataModel } from 'src/app/services/patch-db/data-model' -// Watch for connection status @Injectable({ providedIn: 'root' }) export class RefreshAlertService extends Observable { private readonly stream$ = this.patch.watch$('server-info', 'version').pipe( - map(version => !!this.emver.compare(this.config.version, version)), + map(version => !this.emver.compare(this.config.version, version)), endWith(false), ) From 414bc8c30aa131c7ec5674204cacdf3e58d5fb10 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Tue, 8 Nov 2022 12:12:31 -0700 Subject: [PATCH 2/2] fix refresh bug --- .../toast-container/refresh-alert/refresh-alert.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/projects/ui/src/app/components/toast-container/refresh-alert/refresh-alert.service.ts b/frontend/projects/ui/src/app/components/toast-container/refresh-alert/refresh-alert.service.ts index d77bbd543..43c7f82c4 100644 --- a/frontend/projects/ui/src/app/components/toast-container/refresh-alert/refresh-alert.service.ts +++ b/frontend/projects/ui/src/app/components/toast-container/refresh-alert/refresh-alert.service.ts @@ -9,7 +9,7 @@ import { DataModel } from 'src/app/services/patch-db/data-model' @Injectable({ providedIn: 'root' }) export class RefreshAlertService extends Observable { private readonly stream$ = this.patch.watch$('server-info', 'version').pipe( - map(version => !this.emver.compare(this.config.version, version)), + map(version => !!this.emver.compare(this.config.version, version)), endWith(false), )