diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-16 11:57:01 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-27 09:41:54 +0200 |
commit | 4bda2e47bbc937c401ddcf14c1be53c70481a294 (patch) | |
tree | ae4459f440f54ee061caed0670f942d53f85fe2e /client/src | |
parent | c0ffdd09582fa320446a12ada1d382fedcfcd82a (diff) | |
download | PeerTube-4bda2e47bbc937c401ddcf14c1be53c70481a294.tar.gz PeerTube-4bda2e47bbc937c401ddcf14c1be53c70481a294.tar.zst PeerTube-4bda2e47bbc937c401ddcf14c1be53c70481a294.zip |
Correctly cache server translations
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/app/core/server/server.service.ts | 6 |
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 @@ | |||
1 | import { map, share, switchMap, tap } from 'rxjs/operators' | 1 | import { map, shareReplay, switchMap, tap } from 'rxjs/operators' |
2 | import { HttpClient } from '@angular/common/http' | 2 | import { HttpClient } from '@angular/common/http' |
3 | import { Inject, Injectable, LOCALE_ID } from '@angular/core' | 3 | import { Inject, Injectable, LOCALE_ID } from '@angular/core' |
4 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage' | 4 | import { 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) { |