From e3ee3eaccae6a9ece674d7d76db8e67da499d6c3 Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Sun, 19 Nov 2023 15:24:34 +0200
Subject: added some settings for notifications

---
 src/components/mobile_nav/mobile_nav.vue | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'src/components/mobile_nav/mobile_nav.vue')

diff --git a/src/components/mobile_nav/mobile_nav.vue b/src/components/mobile_nav/mobile_nav.vue
index c2746abe..ecd8290a 100644
--- a/src/components/mobile_nav/mobile_nav.vue
+++ b/src/components/mobile_nav/mobile_nav.vue
@@ -66,6 +66,17 @@
             />
           </FALayers>
         </button>
+        <button
+          v-if="!closingDrawerMarksAsSeen"
+          class="button-unstyled mobile-nav-button"
+          :title="$t('nav.mobile_notifications_close')"
+          @click.stop.prevent="markNotificationsAsSeen()"
+        >
+          <FAIcon
+            class="fa-scale-110 fa-old-padding"
+            icon="check-double"
+          />
+        </button>
         <button
           class="button-unstyled mobile-nav-button"
           :title="$t('nav.mobile_notifications_close')"
-- 
cgit v1.2.3-70-g09d2


From 4e8bb80dbd0ff5993f5613c6cbdfe757af0d0807 Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Wed, 13 Dec 2023 20:37:40 +0200
Subject: fix incorrect title + add counter

---
 src/components/mobile_nav/mobile_nav.js  |  6 ++++++
 src/components/mobile_nav/mobile_nav.vue | 10 ++++++++--
 src/i18n/en.json                         |  1 +
 3 files changed, 15 insertions(+), 2 deletions(-)

(limited to 'src/components/mobile_nav/mobile_nav.vue')

diff --git a/src/components/mobile_nav/mobile_nav.js b/src/components/mobile_nav/mobile_nav.js
index 0cd67990..ec9aeed0 100644
--- a/src/components/mobile_nav/mobile_nav.js
+++ b/src/components/mobile_nav/mobile_nav.js
@@ -57,6 +57,12 @@ const MobileNav = {
     unseenNotificationsCount () {
       return this.unseenNotifications.length + countExtraNotifications(this.$store)
     },
+    unseenCount () {
+      return this.unseenNotifications.length
+    },
+    unseenCountBadgeText () {
+      return `${this.unseenCount ? this.unseenCount : ''}${this.extraNotificationsCount ? '*' : ''}`
+    },
     hideSitename () { return this.$store.state.instance.hideSitename },
     sitename () { return this.$store.state.instance.name },
     isChat () {
diff --git a/src/components/mobile_nav/mobile_nav.vue b/src/components/mobile_nav/mobile_nav.vue
index ecd8290a..f20a509d 100644
--- a/src/components/mobile_nav/mobile_nav.vue
+++ b/src/components/mobile_nav/mobile_nav.vue
@@ -50,7 +50,13 @@
       @touchmove.stop="notificationsTouchMove"
     >
       <div class="mobile-notifications-header">
-        <span class="title">{{ $t('notifications.notifications') }}</span>
+        <span class="title">
+          {{ $t('notifications.notifications') }}
+          <span
+            v-if="unseenCountBadgeText"
+            class="badge badge-notification unseen-count"
+          >{{ unseenCountBadgeText }}</span>
+        </span>
         <span class="spacer" />
         <button
           v-if="notificationsAtTop"
@@ -69,7 +75,7 @@
         <button
           v-if="!closingDrawerMarksAsSeen"
           class="button-unstyled mobile-nav-button"
-          :title="$t('nav.mobile_notifications_close')"
+          :title="$t('nav.mobile_notifications_mark_as_seen')"
           @click.stop.prevent="markNotificationsAsSeen()"
         >
           <FAIcon
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 40da7155..195b5e07 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -189,6 +189,7 @@
     "mobile_notifications": "Open notifications",
     "mobile_notifications": "Open notifications (there are unread ones)",
     "mobile_notifications_close": "Close notifications",
+    "mobile_notifications_mark_as_seen": "Mark all as seen",
     "announcements": "Announcements"
   },
   "notifications": {
-- 
cgit v1.2.3-70-g09d2

