mirror of https://github.com/Chocobozzz/PeerTube
Correctly cache server translations
parent
c0ffdd0958
commit
4bda2e47bb
|
@ -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 { HttpClient } from '@angular/common/http'
|
||||||
import { Inject, Injectable, LOCALE_ID } from '@angular/core'
|
import { Inject, Injectable, LOCALE_ID } from '@angular/core'
|
||||||
import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage'
|
import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage'
|
||||||
|
@ -178,13 +178,13 @@ export class ServerService {
|
||||||
|
|
||||||
// Default locale, nothing to translate
|
// Default locale, nothing to translate
|
||||||
if (isDefaultLocale(completeLocale)) {
|
if (isDefaultLocale(completeLocale)) {
|
||||||
this.localeObservable = of({}).pipe(share())
|
this.localeObservable = of({}).pipe(shareReplay())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.localeObservable = this.http
|
this.localeObservable = this.http
|
||||||
.get(ServerService.BASE_LOCALE_URL + completeLocale + '/server.json')
|
.get(ServerService.BASE_LOCALE_URL + completeLocale + '/server.json')
|
||||||
.pipe(share())
|
.pipe(shareReplay())
|
||||||
}
|
}
|
||||||
|
|
||||||
private saveConfigLocally (config: ServerConfig) {
|
private saveConfigLocally (config: ServerConfig) {
|
||||||
|
|
Loading…
Reference in New Issue