mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-05 22:02:15 +00:00
# Which Problems Are Solved # How the Problems Are Solved # Additional Changes # Additional Context - Closes #10690
This commit is contained in:
@@ -68,7 +68,7 @@ export class GrpcService {
|
||||
|
||||
const browserLanguage = this.translate.getBrowserLang();
|
||||
const language = browserLanguage?.match(supportedLanguagesRegexp) ? browserLanguage : fallbackLanguage;
|
||||
const init = this.translate.use(language || this.translate.defaultLang).pipe(
|
||||
const init = this.translate.use(language).pipe(
|
||||
switchMap(() => this.envService.env),
|
||||
tap((env) => {
|
||||
if (!env?.api || !env?.issuer) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ConnectedPosition, ConnectionPositionPair, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';
|
||||
import { ComponentPortal, PortalInjector } from '@angular/cdk/portal';
|
||||
import { ComponentPortal } from '@angular/cdk/portal';
|
||||
import { ComponentRef, Injectable, Injector } from '@angular/core';
|
||||
|
||||
import { InfoOverlayComponent, OVERLAY_DATA } from '../../modules/info-overlay/info-overlay.component';
|
||||
@@ -47,13 +47,14 @@ export class OverlayService {
|
||||
return containerRef.instance;
|
||||
}
|
||||
|
||||
private createInjector(config: InfoOverlayConfig, dialogRef: OverlayRef): PortalInjector {
|
||||
const injectionTokens = new WeakMap();
|
||||
|
||||
injectionTokens.set(OverlayRef, dialogRef);
|
||||
injectionTokens.set(OVERLAY_DATA, config.content);
|
||||
|
||||
return new PortalInjector(this.injector, injectionTokens);
|
||||
private createInjector(config: InfoOverlayConfig, dialogRef: OverlayRef) {
|
||||
return Injector.create({
|
||||
parent: this.injector,
|
||||
providers: [
|
||||
{ provide: OverlayRef, useValue: dialogRef },
|
||||
{ provide: OVERLAY_DATA, useValue: config.content },
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
private createOverlay(config: InfoOverlayConfig): OverlayRef {
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user