Lint - separated commit to make the next diff clearer
This commit is contained in:
parent
35955f067d
commit
2e49421960
2 changed files with 13 additions and 11 deletions
|
@ -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<string>) {
|
|||
},
|
||||
});
|
||||
})
|
||||
.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));
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue