aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/screens/main/NotificationsScreen.tsx9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/screens/main/NotificationsScreen.tsx b/src/screens/main/NotificationsScreen.tsx
index 675d415d..ed6c246e 100644
--- a/src/screens/main/NotificationsScreen.tsx
+++ b/src/screens/main/NotificationsScreen.tsx
@@ -58,7 +58,7 @@ const NotificationsScreen: React.FC = () => {
const DEFAULT_NOTIFICATIONS_SIZE = 2;
const [moreFooterEnabled, setMoreFooterEnabled] = useState(false);
- const [requestLimit, setrequestLimit] = useState(DEFAULT_NOTIFICATIONS_SIZE);
+ const [requestLimit, setRequestLimit] = useState(DEFAULT_NOTIFICATIONS_SIZE);
const [allFriendRequests, setFriendRequests] = useState<NotificationType[]>(
[],
);
@@ -154,6 +154,7 @@ const NotificationsScreen: React.FC = () => {
}
}
setFriendRequests(friendRequests);
+ setMoreFooterEnabled(requestLimit === friendRequests.length);
setSectionedNotifications(
todays.length === 0 &&
yesterdays.length === 0 &&
@@ -209,8 +210,7 @@ const NotificationsScreen: React.FC = () => {
<TouchableOpacity
style={styles.sectionHeaderContainer}
onPress={() => {
- setrequestLimit(DEFAULT_NOTIFICATIONS_SIZE);
- setMoreFooterEnabled(false);
+ setRequestLimit(DEFAULT_NOTIFICATIONS_SIZE);
}}>
<View
style={[styles.sectionLocation, styles.hiddenSectionContainer]}>
@@ -231,8 +231,7 @@ const NotificationsScreen: React.FC = () => {
<TouchableOpacity
style={styles.sectionHeaderContainer}
onPress={() => {
- setrequestLimit(allFriendRequests.length);
- setMoreFooterEnabled(true);
+ setRequestLimit(allFriendRequests.length);
}}>
<Text
style={[