about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorTakeshi Umeda <noel.yoshiba@gmail.com>2021-04-16 17:06:16 +0900
committerGitHub <noreply@github.com>2021-04-16 10:06:16 +0200
commit9bb334184900f1a4bb0a212cf46542faa0c544fd (patch)
treed8e089754112b8906b3d7ebff5181533c8cc4f28 /app/javascript
parent3b8d085436fa38aed4d5fa3650e433fc7215b104 (diff)
Fix to update suggestion list after dismiss (#16044)
* Fix to update suggestion list after dismiss

* Change to inline

* Fix style
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/mastodon/actions/suggestions.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/javascript/mastodon/actions/suggestions.js b/app/javascript/mastodon/actions/suggestions.js
index 0bf959017..336c0c8f6 100644
--- a/app/javascript/mastodon/actions/suggestions.js
+++ b/app/javascript/mastodon/actions/suggestions.js
@@ -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(() => {});
 };