diff options
author | Chocobozzz <me@florianbigard.com> | 2022-07-15 15:30:14 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-07-18 11:37:18 +0200 |
commit | 42b40636991b97fe818007fab19091764fc5db73 (patch) | |
tree | db431787c06ce898d22e91ff771f795219274fc6 /client/src/app/shared/shared-user-subscription | |
parent | 654d4ede7fa4d0faa71e49bcfab6b65a686397b2 (diff) | |
download | PeerTube-42b40636991b97fe818007fab19091764fc5db73.tar.gz PeerTube-42b40636991b97fe818007fab19091764fc5db73.tar.zst PeerTube-42b40636991b97fe818007fab19091764fc5db73.zip |
Add ability for client to create server logs
Diffstat (limited to 'client/src/app/shared/shared-user-subscription')
-rw-r--r-- | client/src/app/shared/shared-user-subscription/remote-subscribe.component.ts | 3 | ||||
-rw-r--r-- | client/src/app/shared/shared-user-subscription/user-subscription.service.ts | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/client/src/app/shared/shared-user-subscription/remote-subscribe.component.ts b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.ts index 369692715..7bcfdd8aa 100644 --- a/client/src/app/shared/shared-user-subscription/remote-subscribe.component.ts +++ b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { Component, Input, OnInit } from '@angular/core' | 1 | import { Component, Input, OnInit } from '@angular/core' |
2 | import { Notifier } from '@app/core' | 2 | import { Notifier } from '@app/core' |
3 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' | 3 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' |
4 | import { logger } from '@root-helpers/logger' | ||
4 | import { USER_HANDLE_VALIDATOR } from '../form-validators/user-validators' | 5 | import { USER_HANDLE_VALIDATOR } from '../form-validators/user-validators' |
5 | 6 | ||
6 | @Component({ | 7 | @Component({ |
@@ -59,7 +60,7 @@ export class RemoteSubscribeComponent extends FormReactive implements OnInit { | |||
59 | }) | 60 | }) |
60 | .then(window.open) | 61 | .then(window.open) |
61 | .catch(err => { | 62 | .catch(err => { |
62 | console.error(err) | 63 | logger.error(err) |
63 | 64 | ||
64 | this.notifier.error($localize`Cannot fetch information of this remote account`) | 65 | this.notifier.error($localize`Cannot fetch information of this remote account`) |
65 | }) | 66 | }) |
diff --git a/client/src/app/shared/shared-user-subscription/user-subscription.service.ts b/client/src/app/shared/shared-user-subscription/user-subscription.service.ts index 33a2d04fd..9cf6b4d16 100644 --- a/client/src/app/shared/shared-user-subscription/user-subscription.service.ts +++ b/client/src/app/shared/shared-user-subscription/user-subscription.service.ts | |||
@@ -9,7 +9,7 @@ import { Video, VideoChannel, VideoChannelService, VideoService } from '@app/sha | |||
9 | import { ActorFollow, ResultList, VideoChannel as VideoChannelServer, VideoSortField } from '@shared/models' | 9 | import { ActorFollow, ResultList, VideoChannel as VideoChannelServer, VideoSortField } from '@shared/models' |
10 | import { environment } from '../../../environments/environment' | 10 | import { environment } from '../../../environments/environment' |
11 | 11 | ||
12 | const logger = debug('peertube:subscriptions:UserSubscriptionService') | 12 | const debugLogger = debug('peertube:subscriptions:UserSubscriptionService') |
13 | 13 | ||
14 | type SubscriptionExistResult = { [ uri: string ]: boolean } | 14 | type SubscriptionExistResult = { [ uri: string ]: boolean } |
15 | type SubscriptionExistResultObservable = { [ uri: string ]: Observable<boolean> } | 15 | type SubscriptionExistResultObservable = { [ uri: string ]: Observable<boolean> } |
@@ -176,17 +176,17 @@ export class UserSubscriptionService { | |||
176 | } | 176 | } |
177 | 177 | ||
178 | doesSubscriptionExist (nameWithHost: string) { | 178 | doesSubscriptionExist (nameWithHost: string) { |
179 | logger('Running subscription check for %d.', nameWithHost) | 179 | debugLogger('Running subscription check for %d.', nameWithHost) |
180 | 180 | ||
181 | if (nameWithHost in this.myAccountSubscriptionCache) { | 181 | if (nameWithHost in this.myAccountSubscriptionCache) { |
182 | logger('Found cache for %d.', nameWithHost) | 182 | debugLogger('Found cache for %d.', nameWithHost) |
183 | 183 | ||
184 | return of(this.myAccountSubscriptionCache[nameWithHost]) | 184 | return of(this.myAccountSubscriptionCache[nameWithHost]) |
185 | } | 185 | } |
186 | 186 | ||
187 | this.existsSubject.next(nameWithHost) | 187 | this.existsSubject.next(nameWithHost) |
188 | 188 | ||
189 | logger('Fetching from network for %d.', nameWithHost) | 189 | debugLogger('Fetching from network for %d.', nameWithHost) |
190 | return this.existsObservable.pipe( | 190 | return this.existsObservable.pipe( |
191 | filter(existsResult => existsResult[nameWithHost] !== undefined), | 191 | filter(existsResult => existsResult[nameWithHost] !== undefined), |
192 | map(existsResult => existsResult[nameWithHost]), | 192 | map(existsResult => existsResult[nameWithHost]), |