Refactor <Header>
into TypeScript (#33956)
This commit is contained in:
parent
20531d1e07
commit
ebde60ca82
13 changed files with 1121 additions and 859 deletions
|
@ -93,27 +93,23 @@ export const makeGetReport = () => createSelector([
|
|||
|
||||
export const getAccountGallery = createSelector([
|
||||
(state, id) => state.getIn(['timelines', `account:${id}:media`, 'items'], ImmutableList()),
|
||||
state => state.get('statuses'),
|
||||
state => state.get('statuses'),
|
||||
(state, id) => state.getIn(['accounts', id]),
|
||||
], (statusIds, statuses, account) => {
|
||||
let medias = ImmutableList();
|
||||
|
||||
statusIds.forEach(statusId => {
|
||||
const status = statuses.get(statusId).set('account', account);
|
||||
medias = medias.concat(status.get('media_attachments').map(media => media.set('status', status)));
|
||||
let status = statuses.get(statusId);
|
||||
|
||||
if (status) {
|
||||
status = status.set('account', account);
|
||||
medias = medias.concat(status.get('media_attachments').map(media => media.set('status', status)));
|
||||
}
|
||||
});
|
||||
|
||||
return medias;
|
||||
});
|
||||
|
||||
export const getAccountHidden = createSelector([
|
||||
(state, id) => state.getIn(['accounts', id, 'hidden']),
|
||||
(state, id) => state.getIn(['relationships', id, 'following']) || state.getIn(['relationships', id, 'requested']),
|
||||
(state, id) => id === me,
|
||||
], (hidden, followingOrRequested, isSelf) => {
|
||||
return hidden && !(isSelf || followingOrRequested);
|
||||
});
|
||||
|
||||
export const getStatusList = createSelector([
|
||||
(state, type) => state.getIn(['status_lists', type, 'items']),
|
||||
], (items) => items.toList());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue