mirror of https://github.com/Chocobozzz/PeerTube
Fix client build
This commit is contained in:
parent
6fd8c4da26
commit
db84cf89bc
|
@ -7,12 +7,12 @@
|
||||||
<ng-template i18n #single>Subscribe</ng-template>
|
<ng-template i18n #single>Subscribe</ng-template>
|
||||||
<ng-template #multiple>
|
<ng-template #multiple>
|
||||||
<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-template>
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="!isBigButton() && displayFollowers && videoChannels.length > 1 && videoChannels[0].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>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
(click)="subscribe()">
|
(click)="subscribe()">
|
||||||
<ng-template [ngTemplateOutlet]="userLoggedOut"></ng-template>
|
<ng-template [ngTemplateOutlet]="userLoggedOut"></ng-template>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
*ngIf="isAllChannelsSubscribed()" type="button"
|
*ngIf="isAllChannelsSubscribed()" type="button"
|
||||||
class="btn btn-sm" role="button"
|
class="btn btn-sm" role="button"
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button class="dropdown-item" i18n>Subscribe with a Mastodon account:</button>
|
<button class="dropdown-item" i18n>Subscribe with a Mastodon account:</button>
|
||||||
<my-remote-subscribe showHelp="true" [uri]="channelUri"></my-remote-subscribe>
|
<my-remote-subscribe showHelp="true" [uri]="uri"></my-remote-subscribe>
|
||||||
|
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
|
|
||||||
|
|
|
@ -40,11 +40,11 @@ export class SubscribeButtonComponent implements OnInit {
|
||||||
get handle () {
|
get handle () {
|
||||||
return this.account
|
return this.account
|
||||||
? this.account.nameWithHost
|
? this.account.nameWithHost
|
||||||
: this.videoChannels[0].name + '@' + this.videoChannels[0].host
|
: this.videoChannel.name + '@' + this.videoChannel.host
|
||||||
}
|
}
|
||||||
|
|
||||||
get channelHandle () {
|
get channelHandle () {
|
||||||
return this.getChannelHandler(this.videoChannels[0])
|
return this.getChannelHandler(this.videoChannel)
|
||||||
}
|
}
|
||||||
|
|
||||||
get uri () {
|
get uri () {
|
||||||
|
@ -65,6 +65,10 @@ export class SubscribeButtonComponent implements OnInit {
|
||||||
return rssFeed.url
|
return rssFeed.url
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get videoChannel () {
|
||||||
|
return this.videoChannels[0]
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
this.loadSubscribedStatus()
|
this.loadSubscribedStatus()
|
||||||
}
|
}
|
||||||
|
@ -83,7 +87,7 @@ export class SubscribeButtonComponent implements OnInit {
|
||||||
.filter(handle => this.subscribeStatus(false).includes(handle))
|
.filter(handle => this.subscribeStatus(false).includes(handle))
|
||||||
.map(handle => this.userSubscriptionService.addSubscription(handle))
|
.map(handle => this.userSubscriptionService.addSubscription(handle))
|
||||||
|
|
||||||
forkJoin(observableBatch)
|
merge(observableBatch, 2)
|
||||||
.subscribe(
|
.subscribe(
|
||||||
() => {
|
() => {
|
||||||
this.notifier.success(
|
this.notifier.success(
|
||||||
|
@ -153,18 +157,19 @@ export class SubscribeButtonComponent implements OnInit {
|
||||||
this.router.navigate([ '/login' ])
|
this.router.navigate([ '/login' ])
|
||||||
}
|
}
|
||||||
|
|
||||||
private getChannelHandler (videoChannel: VideoChannel) {
|
subscribeStatus (subscribed: boolean) {
|
||||||
return videoChannel.name + '@' + videoChannel.host
|
|
||||||
}
|
|
||||||
|
|
||||||
private subscribeStatus (subscribed: boolean) {
|
|
||||||
const accumulator: string[] = []
|
const accumulator: string[] = []
|
||||||
for (const [key, value] of this.subscribed.entries()) {
|
for (const [key, value] of this.subscribed.entries()) {
|
||||||
if (value === subscribed) accumulator.push(key)
|
if (value === subscribed) accumulator.push(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
return accumulator
|
return accumulator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getChannelHandler (videoChannel: VideoChannel) {
|
||||||
|
return videoChannel.name + '@' + videoChannel.host
|
||||||
|
}
|
||||||
|
|
||||||
private loadSubscribedStatus () {
|
private loadSubscribedStatus () {
|
||||||
if (!this.isUserLoggedIn()) return
|
if (!this.isUserLoggedIn()) return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue