mirror of
https://github.com/mastodon/mastodon
synced 2024-12-18 16:48:22 +09:00
Fix accounts not getting imported into redux store for some filtered notification types (#29588)
This commit is contained in:
parent
0bc17a3d48
commit
95a5713ff7
@ -552,7 +552,10 @@ export const fetchNotificationsForRequest = accountId => (dispatch, getState) =>
|
|||||||
|
|
||||||
api(getState).get('/api/v1/notifications', { params }).then(response => {
|
api(getState).get('/api/v1/notifications', { params }).then(response => {
|
||||||
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
||||||
|
dispatch(importFetchedAccounts(response.data.map(item => item.account)));
|
||||||
dispatch(importFetchedStatuses(response.data.map(item => item.status).filter(status => !!status)));
|
dispatch(importFetchedStatuses(response.data.map(item => item.status).filter(status => !!status)));
|
||||||
|
dispatch(importFetchedAccounts(response.data.filter(item => item.report).map(item => item.report.target_account)));
|
||||||
|
|
||||||
dispatch(fetchNotificationsForRequestSuccess(response.data, next?.uri));
|
dispatch(fetchNotificationsForRequestSuccess(response.data, next?.uri));
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
dispatch(fetchNotificationsForRequestFail(err));
|
dispatch(fetchNotificationsForRequestFail(err));
|
||||||
@ -585,7 +588,10 @@ export const expandNotificationsForRequest = () => (dispatch, getState) => {
|
|||||||
|
|
||||||
api(getState).get(url).then(response => {
|
api(getState).get(url).then(response => {
|
||||||
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
const next = getLinks(response).refs.find(link => link.rel === 'next');
|
||||||
|
dispatch(importFetchedAccounts(response.data.map(item => item.account)));
|
||||||
dispatch(importFetchedStatuses(response.data.map(item => item.status).filter(status => !!status)));
|
dispatch(importFetchedStatuses(response.data.map(item => item.status).filter(status => !!status)));
|
||||||
|
dispatch(importFetchedAccounts(response.data.filter(item => item.report).map(item => item.report.target_account)));
|
||||||
|
|
||||||
dispatch(expandNotificationsForRequestSuccess(response.data, next?.uri));
|
dispatch(expandNotificationsForRequestSuccess(response.data, next?.uri));
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
dispatch(expandNotificationsForRequestFail(err));
|
dispatch(expandNotificationsForRequestFail(err));
|
||||||
|
Loading…
Reference in New Issue
Block a user