1
0
Fork 0

Fix subscribe hotkey

This commit is contained in:
Chocobozzz 2021-07-12 10:03:46 +02:00
parent 6419509bde
commit 77d873c56d
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 9 additions and 2 deletions

View file

@ -696,7 +696,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
if (this.isUserLoggedIn()) { if (this.isUserLoggedIn()) {
this.hotkeys = this.hotkeys.concat([ this.hotkeys = this.hotkeys.concat([
new Hotkey('shift+s', () => { new Hotkey('shift+s', () => {
this.subscribeButton.subscribed ? this.subscribeButton.unsubscribe() : this.subscribeButton.subscribe() this.subscribeButton.isSubscribedToAll()
? this.subscribeButton.unsubscribe()
: this.subscribeButton.subscribe()
return false return false
}, undefined, $localize`Subscribe to the account`) }, undefined, $localize`Subscribe to the account`)
]) ])

View file

@ -164,6 +164,10 @@ export class SubscribeButtonComponent implements OnInit, OnChanges {
return accumulator return accumulator
} }
isSubscribedToAll () {
return Array.from(this.subscribed.values()).every(v => v === true)
}
private getChannelHandler (videoChannel: VideoChannel) { private getChannelHandler (videoChannel: VideoChannel) {
return videoChannel.name + '@' + videoChannel.host return videoChannel.name + '@' + videoChannel.host
} }

View file

@ -45,7 +45,7 @@ describe('Test a videos overview', function () {
}) })
it('Should upload 5 videos in a specific category, tag and channel but not include them in overview', async function () { it('Should upload 5 videos in a specific category, tag and channel but not include them in overview', async function () {
this.timeout(15000) this.timeout(30000)
await wait(3000) await wait(3000)