Detect updates
This commit is contained in:
parent
b40ced8ece
commit
bce4e9a96e
@ -1,7 +1,13 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import {MatSnackBar} from "@angular/material/snack-bar";
|
||||||
|
import {SwUpdate} from "@angular/service-worker";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
templateUrl: 'app.component.html'
|
templateUrl: 'app.component.html'
|
||||||
})
|
})
|
||||||
export class AppComponent { }
|
export class AppComponent {
|
||||||
|
constructor(private snackbar: MatSnackBar, private update: SwUpdate) {
|
||||||
|
update.available.subscribe(() => snackbar.open('Update Available!! 🚀', 'Reload').onAction().subscribe(() => update.activateUpdate()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user