Skip to content

Commit

Permalink
Prevent remote subscribe on accounts
Browse files Browse the repository at this point in the history
Which is not supported by PeerTube
  • Loading branch information
Chocobozzz committed Oct 3, 2023
1 parent 3601872 commit 5cea8f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -168,7 +172,7 @@ export class SubscribeButtonComponent implements OnInit, OnChanges {
}

isRemoteSubscribeAvailable () {
return !this.isUserLoggedIn()
return this.isSingleSubscribe && !this.isUserLoggedIn()
}

private getChannelHandler (videoChannel: VideoChannel) {
Expand Down

0 comments on commit 5cea8f9

Please sign in to comment.