From 95a5713ff73787bdea8a2d5cb848386bf8c4fe80 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 14 Mar 2024 10:34:36 +0100 Subject: [PATCH] Fix accounts not getting imported into redux store for some filtered notification types (#29588) --- app/javascript/mastodon/actions/notifications.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/javascript/mastodon/actions/notifications.js b/app/javascript/mastodon/actions/notifications.js index 30b7601d5..b54cbe27b 100644 --- a/app/javascript/mastodon/actions/notifications.js +++ b/app/javascript/mastodon/actions/notifications.js @@ -552,7 +552,10 @@ export const fetchNotificationsForRequest = accountId => (dispatch, getState) => api(getState).get('/api/v1/notifications', { params }).then(response => { 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(importFetchedAccounts(response.data.filter(item => item.report).map(item => item.report.target_account))); + dispatch(fetchNotificationsForRequestSuccess(response.data, next?.uri)); }).catch(err => { dispatch(fetchNotificationsForRequestFail(err)); @@ -585,7 +588,10 @@ export const expandNotificationsForRequest = () => (dispatch, getState) => { api(getState).get(url).then(response => { 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(importFetchedAccounts(response.data.filter(item => item.report).map(item => item.report.target_account))); + dispatch(expandNotificationsForRequestSuccess(response.data, next?.uri)); }).catch(err => { dispatch(expandNotificationsForRequestFail(err));