From 4bda2e47bbc937c401ddcf14c1be53c70481a294 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 16 Aug 2018 11:57:01 +0200 Subject: [PATCH] Correctly cache server translations --- client/src/app/core/server/server.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts index 6d886d2dd..7823fa80e 100644 --- a/client/src/app/core/server/server.service.ts +++ b/client/src/app/core/server/server.service.ts @@ -1,4 +1,4 @@ -import { map, share, switchMap, tap } from 'rxjs/operators' +import { map, shareReplay, switchMap, tap } from 'rxjs/operators' import { HttpClient } from '@angular/common/http' import { Inject, Injectable, LOCALE_ID } from '@angular/core' import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage' @@ -178,13 +178,13 @@ export class ServerService { // Default locale, nothing to translate if (isDefaultLocale(completeLocale)) { - this.localeObservable = of({}).pipe(share()) + this.localeObservable = of({}).pipe(shareReplay()) return } this.localeObservable = this.http .get(ServerService.BASE_LOCALE_URL + completeLocale + '/server.json') - .pipe(share()) + .pipe(shareReplay()) } private saveConfigLocally (config: ServerConfig) { -- 2.41.0