From b936506f4774a08a44e5ba23ccff965d7a566c24 Mon Sep 17 00:00:00 2001
From: Sol Fisher Romanoff <sol@solfisher.com>
Date: Wed, 14 Sep 2022 21:44:29 +0300
Subject: [PATCH] Hide mentions of bubble timeline if empty

---
 src/components/about/about.js                          | 3 +++
 src/components/about/about.vue                         | 2 +-
 src/components/timeline_menu/timeline_menu.vue         | 1 -
 src/components/timeline_menu/timeline_menu_content.js  | 3 ++-
 src/components/timeline_menu/timeline_menu_content.vue | 2 +-
 5 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/components/about/about.js b/src/components/about/about.js
index e69bf8f9..7998c2d3 100644
--- a/src/components/about/about.js
+++ b/src/components/about/about.js
@@ -20,6 +20,9 @@ const About = {
       return this.$store.state.instance.showInstanceSpecificPanel &&
         !this.$store.getters.mergedConfig.hideISP &&
         this.$store.state.instance.instanceSpecificPanelContent
+    },
+    showLocalBubblePanel () {
+      return this.$store.state.instance.localBubbleInstances.length > 0
     }
   }
 }
diff --git a/src/components/about/about.vue b/src/components/about/about.vue
index 221fc381..df9bb196 100644
--- a/src/components/about/about.vue
+++ b/src/components/about/about.vue
@@ -3,7 +3,7 @@
     <instance-specific-panel v-if="showInstanceSpecificPanel" />
     <staff-panel />
     <terms-of-service-panel />
-    <LocalBubblePanel />
+    <LocalBubblePanel v-if="showLocalBubblePanel" />
     <MRFTransparencyPanel />
     <features-panel v-if="showFeaturesPanel" />
   </div>
diff --git a/src/components/timeline_menu/timeline_menu.vue b/src/components/timeline_menu/timeline_menu.vue
index 5efe7db6..61119482 100644
--- a/src/components/timeline_menu/timeline_menu.vue
+++ b/src/components/timeline_menu/timeline_menu.vue
@@ -135,7 +135,6 @@
   a {
     display: block;
     padding: 0.6em 0.65em;
-    padding-bottom: 0;
 
     &:hover {
       background-color: $fallback--lightBg;
diff --git a/src/components/timeline_menu/timeline_menu_content.js b/src/components/timeline_menu/timeline_menu_content.js
index 9121a983..df15030b 100644
--- a/src/components/timeline_menu/timeline_menu_content.js
+++ b/src/components/timeline_menu/timeline_menu_content.js
@@ -23,7 +23,8 @@ const TimelineMenuContent = {
     ...mapState({
       currentUser: state => state.users.currentUser,
       privateMode: state => state.instance.private,
-      federating: state => state.instance.federating
+      federating: state => state.instance.federating,
+      showBubbleTimeline: state => (state.instance.localBubbleInstances.length > 0)
     })
   }
 }
diff --git a/src/components/timeline_menu/timeline_menu_content.vue b/src/components/timeline_menu/timeline_menu_content.vue
index 2e5d3ce9..27aece22 100644
--- a/src/components/timeline_menu/timeline_menu_content.vue
+++ b/src/components/timeline_menu/timeline_menu_content.vue
@@ -16,7 +16,7 @@
         >{{ $t("nav.home_timeline") }}</span>
       </router-link>
     </li>
-    <li v-if="currentUser">
+    <li v-if="currentUser && showBubbleTimeline">
       <router-link
         class="menu-item"
         :to="{ name: 'bubble-timeline' }"