mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Fix notifications reducer bug
This commit is contained in:
parent
318e63cb79
commit
025f7bb223
2 changed files with 4 additions and 3 deletions
|
@ -76,7 +76,7 @@ export function refreshNotificationsSuccess(notifications, next) {
|
|||
type: NOTIFICATIONS_REFRESH_SUCCESS,
|
||||
notifications,
|
||||
accounts: notifications.map(item => item.account),
|
||||
statuses: notifications.map(item => item.status),
|
||||
statuses: notifications.map(item => item.status).filter(status => !!status),
|
||||
next
|
||||
};
|
||||
};
|
||||
|
@ -120,7 +120,7 @@ export function expandNotificationsSuccess(notifications, next) {
|
|||
type: NOTIFICATIONS_EXPAND_SUCCESS,
|
||||
notifications,
|
||||
accounts: notifications.map(item => item.account),
|
||||
statuses: notifications.map(item => item.status),
|
||||
statuses: notifications.map(item => item.status).filter(status => !!status),
|
||||
next
|
||||
};
|
||||
};
|
||||
|
|
|
@ -78,9 +78,10 @@ export default function accounts(state = initialState, action) {
|
|||
case FAVOURITES_FETCH_SUCCESS:
|
||||
case COMPOSE_SUGGESTIONS_READY:
|
||||
case SEARCH_SUGGESTIONS_READY:
|
||||
return normalizeAccounts(state, action.accounts);
|
||||
case NOTIFICATIONS_REFRESH_SUCCESS:
|
||||
case NOTIFICATIONS_EXPAND_SUCCESS:
|
||||
return normalizeAccounts(state, action.accounts);
|
||||
return normalizeAccountsFromStatuses(normalizeAccounts(state, action.accounts), action.statuses);
|
||||
case TIMELINE_REFRESH_SUCCESS:
|
||||
case TIMELINE_EXPAND_SUCCESS:
|
||||
case ACCOUNT_TIMELINE_FETCH_SUCCESS:
|
||||
|
|
Loading…
Reference in a new issue