aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Kim <brian@tagg.id>2021-06-02 16:18:25 -0700
committerBrian Kim <brian@tagg.id>2021-06-02 16:18:25 -0700
commitf26079e3fcae59f0a97fe31fc29a9f4a43811cbb (patch)
tree7516eac44ddf0d9e93726812e5ddb1031d32adfa
parent43a420ec518f122b684bb9d2f4dd4043bf65d2d2 (diff)
Removed excess function
-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,