diff --git a/ui/redux/actions/notifications.js b/ui/redux/actions/notifications.js index 27d74bf0f..8a7d96b37 100644 --- a/ui/redux/actions/notifications.js +++ b/ui/redux/actions/notifications.js @@ -45,7 +45,7 @@ export function doNotificationList() { return (dispatch: Dispatch) => { dispatch({ type: ACTIONS.NOTIFICATION_LIST_STARTED }); return Lbryio.call('notification', 'list', { is_app_readable: true }) - .then(response => { + .then((response) => { const notifications = response || []; const channelsToResolve = notifications .filter((notification: WebNotification) => { @@ -59,7 +59,7 @@ export function doNotificationList() { return false; } }) - .map(notification => { + .map((notification) => { if (notification.notification_rule === NOTIFICATIONS.NEW_CONTENT) { return notification.notification_parameters.device.target; } else { @@ -70,7 +70,7 @@ export function doNotificationList() { dispatch(doResolveUris(channelsToResolve)); dispatch({ type: ACTIONS.NOTIFICATION_LIST_COMPLETED, data: { notifications } }); }) - .catch(error => { + .catch((error) => { dispatch({ type: ACTIONS.NOTIFICATION_LIST_FAILED, data: { error } }); }); }; @@ -83,8 +83,8 @@ export function doReadNotifications() { const unreadNotifications = notifications && notifications - .filter(notification => !notification.is_read) - .map(notification => notification.id) + .filter((notification) => !notification.is_read) + .map((notification) => notification.id) .join(','); dispatch({ type: ACTIONS.NOTIFICATION_READ_STARTED }); @@ -92,7 +92,7 @@ export function doReadNotifications() { .then(() => { dispatch({ type: ACTIONS.NOTIFICATION_READ_COMPLETED }); }) - .catch(error => { + .catch((error) => { dispatch({ type: ACTIONS.NOTIFICATION_READ_FAILED, data: { error } }); }); }; @@ -110,7 +110,7 @@ export function doSeeNotifications(notificationIds: Array) { }, }); }) - .catch(error => { + .catch((error) => { dispatch({ type: ACTIONS.NOTIFICATION_SEEN_FAILED, data: { error } }); }); }; @@ -121,7 +121,8 @@ export function doSeeAllNotifications() { const state = getState(); const notifications = selectNotifications(state); const unSeenNotifications = - notifications && notifications.filter(notification => !notification.is_seen).map(notification => notification.id); + notifications && + notifications.filter((notification) => !notification.is_seen).map((notification) => notification.id); dispatch(doSeeNotifications(unSeenNotifications)); }; diff --git a/ui/redux/reducers/notifications.js b/ui/redux/reducers/notifications.js index 6c218221b..cf2208717 100644 --- a/ui/redux/reducers/notifications.js +++ b/ui/redux/reducers/notifications.js @@ -55,7 +55,8 @@ export default handleActions( }, [ACTIONS.NOTIFICATION_READ_COMPLETED]: (state, action) => { const { notifications } = state; - const newNotifications = notifications && notifications.map(notification => ({ ...notification, is_read: true })); + const newNotifications = + notifications && notifications.map((notification) => ({ ...notification, is_read: true })); return { ...state, notifications: newNotifications, @@ -69,7 +70,7 @@ export default handleActions( [ACTIONS.NOTIFICATION_SEEN_COMPLETED]: (state, action) => { const { notifications } = state; const { notificationIds } = action.data; - const newNotifications = notifications.map(notification => { + const newNotifications = notifications.map((notification) => { if (notificationIds.includes(notification.id)) { return { ...notification, is_seen: true }; } @@ -85,7 +86,7 @@ export default handleActions( [ACTIONS.NOTIFICATION_DELETE_COMPLETED]: (state, action) => { const { notifications } = state; const { notificationId } = action.data; - const newNotifications = notifications.filter(notification => { + const newNotifications = notifications.filter((notification) => { return notification.id !== notificationId; });