diff options
author | Chocobozzz <me@florianbigard.com> | 2023-10-03 10:20:29 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-10-03 10:20:29 +0200 |
commit | 5cea8f956721038e280695aae1390198c0b8a1e1 (patch) | |
tree | 2eaa4f01bc0b89f2a48308d7cf9c45fa7b6db4db | |
parent | 3601872153ee06a2b58b7fb45898e2b7acbb62ea (diff) | |
download | PeerTube-5cea8f956721038e280695aae1390198c0b8a1e1.tar.gz PeerTube-5cea8f956721038e280695aae1390198c0b8a1e1.tar.zst PeerTube-5cea8f956721038e280695aae1390198c0b8a1e1.zip |
Prevent remote subscribe on accounts
Which is not supported by PeerTube
-rw-r--r-- | client/src/app/shared/shared-user-subscription/subscribe-button.component.html | 9 | ||||
-rw-r--r-- | client/src/app/shared/shared-user-subscription/subscribe-button.component.ts | 6 |
2 files changed, 10 insertions, 5 deletions
diff --git a/client/src/app/shared/shared-user-subscription/subscribe-button.component.html b/client/src/app/shared/shared-user-subscription/subscribe-button.component.html index 341b83a04..d1d551c18 100644 --- a/client/src/app/shared/shared-user-subscription/subscribe-button.component.html +++ b/client/src/app/shared/shared-user-subscription/subscribe-button.component.html | |||
@@ -5,15 +5,16 @@ | |||
5 | 5 | ||
6 | <ng-template #userLoggedOut> | 6 | <ng-template #userLoggedOut> |
7 | <span [ngClass]="{ 'extra-text': isAtLeastOneChannelSubscribed }"> | 7 | <span [ngClass]="{ 'extra-text': isAtLeastOneChannelSubscribed }"> |
8 | <ng-container *ngIf="account; then multiple; else single"></ng-container> | 8 | <ng-container i18n *ngIf="isSingleSubscribe">Subscribe</ng-container> |
9 | <ng-template i18n #single>Subscribe</ng-template> | 9 | |
10 | <ng-template #multiple> | 10 | <ng-container *ngIf="!isSingleSubscribe"> |
11 | <span i18n>Subscribe to all channels</span> | 11 | <span i18n>Subscribe to all channels</span> |
12 | <span *ngIf="isAtLeastOneChannelSubscribed">{{ subscribeStatus(true).length }}/{{ subscribed.size }} | 12 | <span *ngIf="isAtLeastOneChannelSubscribed">{{ subscribeStatus(true).length }}/{{ subscribed.size }} |
13 | <ng-container i18n>channels subscribed</ng-container> | 13 | <ng-container i18n>channels subscribed</ng-container> |
14 | </span> | 14 | </span> |
15 | </ng-template> | 15 | </ng-container> |
16 | </span> | 16 | </span> |
17 | |||
17 | <span *ngIf="!isBigButton && displayFollowers && videoChannels.length > 1 && videoChannel.followersCount !== 0" class="followers-count"> | 18 | <span *ngIf="!isBigButton && displayFollowers && videoChannels.length > 1 && videoChannel.followersCount !== 0" class="followers-count"> |
18 | {{ videoChannels[0].followersCount | myNumberFormatter }} | 19 | {{ videoChannels[0].followersCount | myNumberFormatter }} |
19 | </span> | 20 | </span> |
diff --git a/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts b/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts index 2a5751824..4e15f7bc0 100644 --- a/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts +++ b/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts | |||
@@ -76,6 +76,10 @@ export class SubscribeButtonComponent implements OnInit, OnChanges { | |||
76 | return this.isUserLoggedIn() && this.videoChannels.length > 1 && this.isAtLeastOneChannelSubscribed | 76 | return this.isUserLoggedIn() && this.videoChannels.length > 1 && this.isAtLeastOneChannelSubscribed |
77 | } | 77 | } |
78 | 78 | ||
79 | get isSingleSubscribe () { | ||
80 | return !this.account | ||
81 | } | ||
82 | |||
79 | ngOnInit () { | 83 | ngOnInit () { |
80 | this.loadSubscribedStatus() | 84 | this.loadSubscribedStatus() |
81 | } | 85 | } |
@@ -168,7 +172,7 @@ export class SubscribeButtonComponent implements OnInit, OnChanges { | |||
168 | } | 172 | } |
169 | 173 | ||
170 | isRemoteSubscribeAvailable () { | 174 | isRemoteSubscribeAvailable () { |
171 | return !this.isUserLoggedIn() | 175 | return this.isSingleSubscribe && !this.isUserLoggedIn() |
172 | } | 176 | } |
173 | 177 | ||
174 | private getChannelHandler (videoChannel: VideoChannel) { | 178 | private getChannelHandler (videoChannel: VideoChannel) { |