Prevent remote subscribe on accounts

Which is not supported by PeerTube
This commit is contained in:
Chocobozzz 2023-10-03 10:20:29 +02:00
parent 3601872153
commit 5cea8f9567
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 10 additions and 5 deletions

View File

@ -5,15 +5,16 @@
<ng-template #userLoggedOut> <ng-template #userLoggedOut>
<span [ngClass]="{ 'extra-text': isAtLeastOneChannelSubscribed }"> <span [ngClass]="{ 'extra-text': isAtLeastOneChannelSubscribed }">
<ng-container *ngIf="account; then multiple; else single"></ng-container> <ng-container i18n *ngIf="isSingleSubscribe">Subscribe</ng-container>
<ng-template i18n #single>Subscribe</ng-template>
<ng-template #multiple> <ng-container *ngIf="!isSingleSubscribe">
<span i18n>Subscribe to all channels</span> <span i18n>Subscribe to all channels</span>
<span *ngIf="isAtLeastOneChannelSubscribed">{{ subscribeStatus(true).length }}/{{ subscribed.size }} <span *ngIf="isAtLeastOneChannelSubscribed">{{ subscribeStatus(true).length }}/{{ subscribed.size }}
<ng-container i18n>channels subscribed</ng-container> <ng-container i18n>channels subscribed</ng-container>
</span> </span>
</ng-template> </ng-container>
</span> </span>
<span *ngIf="!isBigButton && displayFollowers && videoChannels.length > 1 && videoChannel.followersCount !== 0" class="followers-count"> <span *ngIf="!isBigButton && displayFollowers && videoChannels.length > 1 && videoChannel.followersCount !== 0" class="followers-count">
{{ videoChannels[0].followersCount | myNumberFormatter }} {{ videoChannels[0].followersCount | myNumberFormatter }}
</span> </span>

View File

@ -76,6 +76,10 @@ export class SubscribeButtonComponent implements OnInit, OnChanges {
return this.isUserLoggedIn() && this.videoChannels.length > 1 && this.isAtLeastOneChannelSubscribed return this.isUserLoggedIn() && this.videoChannels.length > 1 && this.isAtLeastOneChannelSubscribed
} }
get isSingleSubscribe () {
return !this.account
}
ngOnInit () { ngOnInit () {
this.loadSubscribedStatus() this.loadSubscribedStatus()
} }
@ -168,7 +172,7 @@ export class SubscribeButtonComponent implements OnInit, OnChanges {
} }
isRemoteSubscribeAvailable () { isRemoteSubscribeAvailable () {
return !this.isUserLoggedIn() return this.isSingleSubscribe && !this.isUserLoggedIn()
} }
private getChannelHandler (videoChannel: VideoChannel) { private getChannelHandler (videoChannel: VideoChannel) {