about summary refs log tree commit diff
path: root/app/javascript/mastodon/reducers/suggestions.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-07-25 04:17:35 +0200
committerGitHub <noreply@github.com>2019-07-25 04:17:35 +0200
commit4eeff26533b75b592395e353c6d4506db9958bcf (patch)
treecfb3483e2c6d24ed0d6ae0e390cba0e274285700 /app/javascript/mastodon/reducers/suggestions.js
parent94f5c714f11248df6a2b793f47cdb30028f67fca (diff)
Change account domain block to clear out notifications and follows (#11393)
Diffstat (limited to 'app/javascript/mastodon/reducers/suggestions.js')
-rw-r--r--app/javascript/mastodon/reducers/suggestions.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/javascript/mastodon/reducers/suggestions.js b/app/javascript/mastodon/reducers/suggestions.js
index 9f4b89d58..834be728f 100644
--- a/app/javascript/mastodon/reducers/suggestions.js
+++ b/app/javascript/mastodon/reducers/suggestions.js
@@ -4,6 +4,8 @@ import {
   SUGGESTIONS_FETCH_FAIL,
   SUGGESTIONS_DISMISS,
 } from '../actions/suggestions';
+import { ACCOUNT_BLOCK_SUCCESS, ACCOUNT_MUTE_SUCCESS } from 'mastodon/actions/accounts';
+import { DOMAIN_BLOCK_SUCCESS } from 'mastodon/actions/domain_blocks';
 import { Map as ImmutableMap, List as ImmutableList, fromJS } from 'immutable';
 
 const initialState = ImmutableMap({
@@ -24,6 +26,11 @@ export default function suggestionsReducer(state = initialState, action) {
     return state.set('isLoading', false);
   case SUGGESTIONS_DISMISS:
     return state.update('items', list => list.filterNot(id => id === action.id));
+  case ACCOUNT_BLOCK_SUCCESS:
+  case ACCOUNT_MUTE_SUCCESS:
+    return state.update('items', list => list.filterNot(id => id === action.relationship.id));
+  case DOMAIN_BLOCK_SUCCESS:
+    return state.update('items', list => list.filterNot(id => action.accounts.includes(id)));
   default:
     return state;
   }