diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-17 11:27:47 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-17 14:01:45 +0200 |
commit | 1378c0d343028f3d40d7d795422684ab9e6a1599 (patch) | |
tree | 08062b84a38a7e2dfe0aa674e7ca8e1b7321044e /client/src/app/core/plugins | |
parent | c186a67f90203af6bfa434f026efdc99193bcd65 (diff) | |
download | PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.gz PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.zst PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.zip |
Fix client lint
Diffstat (limited to 'client/src/app/core/plugins')
-rw-r--r-- | client/src/app/core/plugins/plugin.service.ts | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/client/src/app/core/plugins/plugin.service.ts b/client/src/app/core/plugins/plugin.service.ts index 16108e17a..774c03964 100644 --- a/client/src/app/core/plugins/plugin.service.ts +++ b/client/src/app/core/plugins/plugin.service.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { Observable, of } from 'rxjs' | 1 | import { firstValueFrom, Observable, of } from 'rxjs' |
2 | import { catchError, map, shareReplay } from 'rxjs/operators' | 2 | import { catchError, map, shareReplay } from 'rxjs/operators' |
3 | import { HttpClient } from '@angular/common/http' | 3 | import { HttpClient } from '@angular/common/http' |
4 | import { Inject, Injectable, LOCALE_ID, NgZone } from '@angular/core' | 4 | import { Inject, Injectable, LOCALE_ID, NgZone } from '@angular/core' |
@@ -164,18 +164,20 @@ export class PluginService implements ClientHook { | |||
164 | getSettings: () => { | 164 | getSettings: () => { |
165 | const path = PluginService.BASE_PLUGIN_API_URL + '/' + npmName + '/public-settings' | 165 | const path = PluginService.BASE_PLUGIN_API_URL + '/' + npmName + '/public-settings' |
166 | 166 | ||
167 | return this.authHttp.get<PublicServerSetting>(path) | 167 | const obs = this.authHttp.get<PublicServerSetting>(path) |
168 | .pipe( | 168 | .pipe( |
169 | map(p => p.publicSettings), | 169 | map(p => p.publicSettings), |
170 | catchError(res => this.restExtractor.handleError(res)) | 170 | catchError(res => this.restExtractor.handleError(res)) |
171 | ) | 171 | ) |
172 | .toPromise() | 172 | |
173 | return firstValueFrom(obs) | ||
173 | }, | 174 | }, |
174 | 175 | ||
175 | getServerConfig: () => { | 176 | getServerConfig: () => { |
176 | return this.server.getConfig() | 177 | const obs = this.server.getConfig() |
177 | .pipe(catchError(res => this.restExtractor.handleError(res))) | 178 | .pipe(catchError(res => this.restExtractor.handleError(res))) |
178 | .toPromise() | 179 | |
180 | return firstValueFrom(obs) | ||
179 | }, | 181 | }, |
180 | 182 | ||
181 | isLoggedIn: () => { | 183 | isLoggedIn: () => { |
@@ -216,10 +218,11 @@ export class PluginService implements ClientHook { | |||
216 | }, | 218 | }, |
217 | 219 | ||
218 | translate: (value: string) => { | 220 | translate: (value: string) => { |
219 | return this.translationsObservable | 221 | const obs = this.translationsObservable |
220 | .pipe(map(allTranslations => allTranslations[npmName])) | 222 | .pipe(map(allTranslations => allTranslations[npmName])) |
221 | .pipe(map(translations => peertubeTranslate(value, translations))) | 223 | .pipe(map(translations => peertubeTranslate(value, translations))) |
222 | .toPromise() | 224 | |
225 | return firstValueFrom(obs) | ||
223 | } | 226 | } |
224 | } | 227 | } |
225 | } | 228 | } |