pl-fe: invalidate blocks/mutes list on block/mute

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2025-10-27 12:02:18 +01:00
parent d94c19fd9d
commit 37bba441ed

View File

@ -105,6 +105,10 @@ const useBlockAccountMutation = (accountId: string) => {
? suggestions.filter((suggestion) => suggestion.account_id !== accountId)
: undefined);
queryClient.invalidateQueries({
queryKey: ['accountsLists', 'blocked'],
});
// Pass in entire statuses map so we can use it to filter stuff in different parts of the reducers
return dispatch<AccountsAction>((dispatch, getState) => dispatch({
type: ACCOUNT_BLOCK_SUCCESS,
@ -151,6 +155,10 @@ const useMuteAccountMutation = (accountId: string) => {
? suggestions.filter((suggestion) => suggestion.account_id !== accountId)
: undefined);
queryClient.invalidateQueries({
queryKey: ['accountsLists', 'muted'],
});
// Pass in entire statuses map so we can use it to filter stuff in different parts of the reducers
return dispatch<AccountsAction>((dispatch, getState) => dispatch({
type: ACCOUNT_MUTE_SUCCESS,