From f26079e3fcae59f0a97fe31fc29a9f4a43811cbb Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Wed, 2 Jun 2021 16:18:25 -0700 Subject: Removed excess function --- src/utils/common.ts | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'src') diff --git a/src/utils/common.ts b/src/utils/common.ts index 9d0de64b..049dae90 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -101,27 +101,6 @@ export const haveUnreadNotifications = async ( return false; }; -export const getUnreadNotifications = async ( - notifications: NotificationType[], -): Promise => { - const outputNotifications = []; - for (const n of notifications) { - const notificationDate = moment(n.timestamp); - const prevLastViewed = await AsyncStorage.getItem('notificationLastViewed'); - const lastViewed: moment.Moment | undefined = - prevLastViewed == null ? moment.unix(0) : moment(prevLastViewed); - const dateAge = getDateAge(notificationDate); - if (dateAge === 'unknown') { - continue; - } - const unread = lastViewed ? lastViewed.diff(notificationDate) < 0 : false; - if (unread) { - outputNotifications.push(n); - } - } - return outputNotifications; -}; - // https://stackoverflow.com/a/2450976 export const shuffle = (array: any[]) => { var currentIndex = array.length, -- cgit v1.2.3-70-g09d2