Browse Source

Fix to update suggestion list after dismiss (#16044)

* Fix to update suggestion list after dismiss

* Change to inline

* Fix style
closed-social-v3
Takeshi Umeda 3 years ago
committed by GitHub
parent
commit
9bb3341849
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      app/javascript/mastodon/actions/suggestions.js

+ 8
- 1
app/javascript/mastodon/actions/suggestions.js View File

@ -48,5 +48,12 @@ export const dismissSuggestion = accountId => (dispatch, getState) => {
id: accountId,
});
api(getState).delete(`/api/v1/suggestions/${accountId}`);
api(getState).delete(`/api/v1/suggestions/${accountId}`).then(() => {
dispatch(fetchSuggestionsRequest());
api(getState).get('/api/v2/suggestions').then(response => {
dispatch(importFetchedAccounts(response.data.map(x => x.account)));
dispatch(fetchSuggestionsSuccess(response.data));
}).catch(error => dispatch(fetchSuggestionsFail(error)));
}).catch(() => {});
};

Loading…
Cancel
Save