aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-16 11:57:01 +0200
committerChocobozzz <me@florianbigard.com>2018-08-27 09:41:54 +0200
commit4bda2e47bbc937c401ddcf14c1be53c70481a294 (patch)
treeae4459f440f54ee061caed0670f942d53f85fe2e
parentc0ffdd09582fa320446a12ada1d382fedcfcd82a (diff)
downloadPeerTube-4bda2e47bbc937c401ddcf14c1be53c70481a294.tar.gz
PeerTube-4bda2e47bbc937c401ddcf14c1be53c70481a294.tar.zst
PeerTube-4bda2e47bbc937c401ddcf14c1be53c70481a294.zip
Correctly cache server translations
-rw-r--r--client/src/app/core/server/server.service.ts6
1 files 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 @@
1import { map, share, switchMap, tap } from 'rxjs/operators' 1import { map, shareReplay, switchMap, tap } from 'rxjs/operators'
2import { HttpClient } from '@angular/common/http' 2import { HttpClient } from '@angular/common/http'
3import { Inject, Injectable, LOCALE_ID } from '@angular/core' 3import { Inject, Injectable, LOCALE_ID } from '@angular/core'
4import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage' 4import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage'
@@ -178,13 +178,13 @@ export class ServerService {
178 178
179 // Default locale, nothing to translate 179 // Default locale, nothing to translate
180 if (isDefaultLocale(completeLocale)) { 180 if (isDefaultLocale(completeLocale)) {
181 this.localeObservable = of({}).pipe(share()) 181 this.localeObservable = of({}).pipe(shareReplay())
182 return 182 return
183 } 183 }
184 184
185 this.localeObservable = this.http 185 this.localeObservable = this.http
186 .get(ServerService.BASE_LOCALE_URL + completeLocale + '/server.json') 186 .get(ServerService.BASE_LOCALE_URL + completeLocale + '/server.json')
187 .pipe(share()) 187 .pipe(shareReplay())
188 } 188 }
189 189
190 private saveConfigLocally (config: ServerConfig) { 190 private saveConfigLocally (config: ServerConfig) {