aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/screens/main/NotificationsScreen.tsx13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/screens/main/NotificationsScreen.tsx b/src/screens/main/NotificationsScreen.tsx
index ed6c246e..501c44fc 100644
--- a/src/screens/main/NotificationsScreen.tsx
+++ b/src/screens/main/NotificationsScreen.tsx
@@ -57,7 +57,7 @@ const NotificationsScreen: React.FC = () => {
const DEFAULT_NOTIFICATIONS_SIZE = 2;
- const [moreFooterEnabled, setMoreFooterEnabled] = useState(false);
+ const [footerEnabled, setFooterEnabled] = useState(false);
const [requestLimit, setRequestLimit] = useState(DEFAULT_NOTIFICATIONS_SIZE);
const [allFriendRequests, setFriendRequests] = useState<NotificationType[]>(
[],
@@ -154,7 +154,10 @@ const NotificationsScreen: React.FC = () => {
}
}
setFriendRequests(friendRequests);
- setMoreFooterEnabled(requestLimit === friendRequests.length);
+ setFooterEnabled(
+ requestLimit === friendRequests.length &&
+ friendRequests.length > DEFAULT_NOTIFICATIONS_SIZE,
+ );
setSectionedNotifications(
todays.length === 0 &&
yesterdays.length === 0 &&
@@ -200,12 +203,12 @@ const NotificationsScreen: React.FC = () => {
);
const renderSectionFooter = ({
- section: {title, data},
+ section: {title},
}: {
- section: {title: string; data: NotificationType[]};
+ section: {title: string};
}) => {
if (title === 'Friend Requests') {
- if (moreFooterEnabled) {
+ if (footerEnabled) {
return (
<TouchableOpacity
style={styles.sectionHeaderContainer}