From 664757ff9f48bddccf3accea3c11c367f3d141c8 Mon Sep 17 00:00:00 2001 From: ankit-thanekar007 Date: Mon, 15 Mar 2021 13:56:33 -0700 Subject: TMA 643: FR changes --- src/screens/main/NotificationsScreen.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') 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( [], ); @@ -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 = () => { { - setrequestLimit(DEFAULT_NOTIFICATIONS_SIZE); - setMoreFooterEnabled(false); + setRequestLimit(DEFAULT_NOTIFICATIONS_SIZE); }}> @@ -231,8 +231,7 @@ const NotificationsScreen: React.FC = () => { { - setrequestLimit(allFriendRequests.length); - setMoreFooterEnabled(true); + setRequestLimit(allFriendRequests.length); }}>