Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix subscribe hotkey

Chocobozzz77d873c56d11
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts
index 85b8822257..d078844c3e 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/+videos/+video-watch/video-watch.component.ts
@@ -696,7 +696,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
if (this.isUserLoggedIn()) {
this.hotkeys = this.hotkeys.concat([
new Hotkey('shift+s', () => {
- this.subscribeButton.subscribed ? this.subscribeButton.unsubscribe() : this.subscribeButton.subscribe()
+ this.subscribeButton.isSubscribedToAll()
+ ? this.subscribeButton.unsubscribe()
+ : this.subscribeButton.subscribe()
+
return false
}, undefined, $localize`Subscribe to the account`)
])
diff --git a/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts b/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts
index b918fda06a..2261e07dd5 100644
--- a/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts
+++ b/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts
@@ -164,6 +164,10 @@ export class SubscribeButtonComponent implements OnInit, OnChanges {
return accumulator
}
+ isSubscribedToAll () {
+ return Array.from(this.subscribed.values()).every(v => v === true)
+ }
+
private getChannelHandler (videoChannel: VideoChannel) {
return videoChannel.name + '@' + videoChannel.host
}
diff --git a/server/tests/api/videos/videos-overview.ts b/server/tests/api/videos/videos-overview.ts
index 7889bcf80a..b4de7c06ce 100644
--- a/server/tests/api/videos/videos-overview.ts
+++ b/server/tests/api/videos/videos-overview.ts
@@ -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 () {
- this.timeout(15000)
+ this.timeout(30000)
await wait(3000)