Files
zitadel/console/src/app/services/update.service.ts
T
b099a26a16 feat(console): MDC components (#6482)
mdc components

---------

Co-authored-by: Elio Bischof <[email protected]>
2023-10-26 08:29:06 +00:00

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();
});
});
}
}