Code style improvements in JavaScript (#13159)
* JS-linter: fix trailing comma's * Configure eslinter to ignore this onchange error.
This commit is contained in:
@ -72,11 +72,11 @@ const expandNormalizedNotifications = (state, notifications, next, isLoadingRece
|
||||
|
||||
mutable.update(usePendingItems ? 'pendingItems' : 'items', list => {
|
||||
const lastIndex = 1 + list.findLastIndex(
|
||||
item => item !== null && (compareId(item.get('id'), items.last().get('id')) > 0 || item.get('id') === items.last().get('id'))
|
||||
item => item !== null && (compareId(item.get('id'), items.last().get('id')) > 0 || item.get('id') === items.last().get('id')),
|
||||
);
|
||||
|
||||
const firstIndex = 1 + list.take(lastIndex).findLastIndex(
|
||||
item => item !== null && compareId(item.get('id'), items.first().get('id')) > 0
|
||||
item => item !== null && compareId(item.get('id'), items.first().get('id')) > 0,
|
||||
);
|
||||
|
||||
return list.take(firstIndex).concat(items, list.skip(lastIndex));
|
||||
|
@ -54,7 +54,7 @@ const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, is
|
||||
|
||||
return oldIds.take(firstIndex + 1).concat(
|
||||
isPartial && oldIds.get(firstIndex) !== null ? newIds.unshift(null) : newIds,
|
||||
oldIds.skip(lastIndex)
|
||||
oldIds.skip(lastIndex),
|
||||
);
|
||||
});
|
||||
}
|
||||
@ -166,7 +166,7 @@ export default function timelines(state = initialState, action) {
|
||||
return state.update(
|
||||
action.timeline,
|
||||
initialTimeline,
|
||||
map => map.set('online', false).update(action.usePendingItems ? 'pendingItems' : 'items', items => items.first() ? items.unshift(null) : items)
|
||||
map => map.set('online', false).update(action.usePendingItems ? 'pendingItems' : 'items', items => items.first() ? items.unshift(null) : items),
|
||||
);
|
||||
default:
|
||||
return state;
|
||||
|
Reference in New Issue
Block a user