Prevent remote subscribe on accounts

Which is not supported by PeerTube
pull/5992/head
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>
<span [ngClass]="{ 'extra-text': isAtLeastOneChannelSubscribed }">
<ng-container *ngIf="account; then multiple; else single"></ng-container>
<ng-template i18n #single>Subscribe</ng-template>
<ng-template #multiple>
<ng-container i18n *ngIf="isSingleSubscribe">Subscribe</ng-container>
<ng-container *ngIf="!isSingleSubscribe">
<span i18n>Subscribe to all channels</span>
<span *ngIf="isAtLeastOneChannelSubscribed">{{ subscribeStatus(true).length }}/{{ subscribed.size }}
<ng-container i18n>channels subscribed</ng-container>
</span>
</ng-template>
</ng-container>
</span>
<span *ngIf="!isBigButton && displayFollowers && videoChannels.length > 1 && videoChannel.followersCount !== 0" class="followers-count">
{{ videoChannels[0].followersCount | myNumberFormatter }}
</span>

View File

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