about summary refs log tree commit diff
path: root/src/view/shell/Drawer.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-04-19 20:11:10 -0500
committerGitHub <noreply@github.com>2023-04-19 20:11:10 -0500
commit04e0ebe8fc4ec32501cc4138e0357308a171807c (patch)
tree23b6b56aa5517796f3352d59ca47aa4804270a39 /src/view/shell/Drawer.tsx
parentb24ba3adc93cf940eb936309ae73a2c205eaef24 (diff)
downloadvoidsky-04e0ebe8fc4ec32501cc4138e0357308a171807c.tar.zst
Feed and notifs improvements (#498)
* Reduce frequency of the notifications sync

* Reduce frequency of home feed polling

* Ensure loading spinner is visible in notifications

* Render notifications loading spinner in the flatlist

* Fixes and performance improvements to notifications

* Render 30+ on notifications if at max

* Fix issue with repeating posts in home feed

* Dont check for unread notifs if we're already at max
Diffstat (limited to 'src/view/shell/Drawer.tsx')
-rw-r--r--src/view/shell/Drawer.tsx12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx
index 74e10d6a1..7128d4213 100644
--- a/src/view/shell/Drawer.tsx
+++ b/src/view/shell/Drawer.tsx
@@ -203,9 +203,7 @@ export const DrawerContent = observer(() => {
               )
             }
             label="Notifications"
-            count={
-              store.me.notifications.unreadCount + store.invitedUsers.numNotifs
-            }
+            count={store.me.notifications.unreadCountLabel}
             bold={isAtNotifications}
             onPress={onPressNotifications}
           />
@@ -291,7 +289,7 @@ function MenuItem({
 }: {
   icon: JSX.Element
   label: string
-  count?: number
+  count?: string
   bold?: boolean
   onPress: () => void
 }) {
@@ -307,14 +305,14 @@ function MenuItem({
           <View
             style={[
               styles.menuItemCount,
-              count > 99
+              count.length > 2
                 ? styles.menuItemCountHundreds
-                : count > 9
+                : count.length > 1
                 ? styles.menuItemCountTens
                 : undefined,
             ]}>
             <Text style={styles.menuItemCountLabel} numberOfLines={1}>
-              {count > 999 ? `${Math.round(count / 1000)}k` : count}
+              {count}
             </Text>
           </View>
         ) : undefined}