From 1d54b2052c2144a9c3811fab6d641ee8ddeb1085 Mon Sep 17 00:00:00 2001
From: Chocobozzz <me@florianbigard.com>
Date: Tue, 22 Feb 2022 14:38:57 +0100
Subject: Hide remote subscribe if logged in

---
 .../shared/shared-user-subscription/subscribe-button.component.html   | 2 +-
 .../app/shared/shared-user-subscription/subscribe-button.component.ts | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/client/src/app/shared/shared-user-subscription/subscribe-button.component.html b/client/src/app/shared/shared-user-subscription/subscribe-button.component.html
index d8699ff69..d08d7f4ed 100644
--- a/client/src/app/shared/shared-user-subscription/subscribe-button.component.html
+++ b/client/src/app/shared/shared-user-subscription/subscribe-button.component.html
@@ -58,7 +58,7 @@
         <span *ngIf="isUserLoggedIn()" i18n>Subscribe with your local account</span>
       </button>
 
-      <button class="dropdown-item dropdown-item-neutral">
+      <button *ngIf="isRemoteSubscribeAvailable()" class="dropdown-item dropdown-item-neutral">
         <div class="mb-1" i18n>Subscribe with a remote account:</div>
         <my-remote-subscribe [showHelp]="true" [uri]="uri"></my-remote-subscribe>
       </button>
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 180bc0565..7a55a6ffb 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
@@ -168,6 +168,10 @@ export class SubscribeButtonComponent implements OnInit, OnChanges {
     return Array.from(this.subscribed.values()).every(v => v === true)
   }
 
+  isRemoteSubscribeAvailable () {
+    return !this.isUserLoggedIn()
+  }
+
   private getChannelHandler (videoChannel: VideoChannel) {
     return videoChannel.name + '@' + videoChannel.host
   }
-- 
cgit v1.2.3