mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-27 01:32:15 +00:00
22 lines
518 B
TypeScript
22 lines
518 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
import { SwUpdate } from '@angular/service-worker';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class UpdateService {
|
|
constructor(
|
|
private swUpdate: SwUpdate,
|
|
snackbar: MatSnackBar,
|
|
) {
|
|
this.swUpdate.available.subscribe((evt) => {
|
|
const snack = snackbar.open('Update Available', 'Reload');
|
|
|
|
snack.onAction().subscribe(() => {
|
|
window.location.reload();
|
|
});
|
|
});
|
|
}
|
|
}
|