From 4840601b93bafd7dd61568cdaa092348fe4544e0 Mon Sep 17 00:00:00 2001 From: ztimson Date: Sat, 24 Aug 2019 19:53:01 -0400 Subject: [PATCH] Reload page after update --- src/app/app.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 63409a2..32d6677 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -8,6 +8,9 @@ import {SwUpdate} from "@angular/service-worker"; }) export class AppComponent { constructor(private snackbar: MatSnackBar, private update: SwUpdate) { - update.available.subscribe(() => snackbar.open('Update Available!! 🚀', 'Reload').onAction().subscribe(() => update.activateUpdate())) + update.available.subscribe(() => snackbar.open('Update Available!! 🚀', 'Reload').onAction().subscribe(async () => { + await update.activateUpdate(); + window.location.reload(); + })) } }