aboutsummaryrefslogtreecommitdiff
path: root/src/utils/common.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/common.ts')
-rw-r--r--src/utils/common.ts21
1 files changed, 0 insertions, 21 deletions
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<NotificationType[]> => {
- 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,