chore(console): Angular 20 #10690 (#10768)

# Which Problems Are Solved


# How the Problems Are Solved

# Additional Changes

# Additional Context
- Closes #10690
This commit is contained in:
Ramon
2025-10-08 07:10:50 +00:00
committed by GitHub
parent 4c078c1474
commit e47acaeef2
272 changed files with 3264 additions and 5037 deletions
+13 -4
View File
@@ -1,6 +1,8 @@
import { Injectable } from '@angular/core';
import { MatSnackBar } from '@angular/material/snack-bar';
import { SwUpdate } from '@angular/service-worker';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { NEVER, switchMap } from 'rxjs';
@Injectable({
providedIn: 'root',
@@ -10,12 +12,19 @@ export class UpdateService {
private swUpdate: SwUpdate,
snackbar: MatSnackBar,
) {
this.swUpdate.available.subscribe((evt) => {
const snack = snackbar.open('Update Available', 'Reload');
this.swUpdate.versionUpdates
.pipe(
switchMap((event) => {
if (event.type !== 'VERSION_DETECTED') {
return NEVER;
}
snack.onAction().subscribe(() => {
return snackbar.open('Update Available', 'Reload').onAction();
}),
takeUntilDestroyed(),
)
.subscribe(() => {
window.location.reload();
});
});
}
}