about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2022-10-14 23:14:22 +0900
committerGitHub <noreply@github.com>2022-10-14 16:14:22 +0200
commite02bdc14fdf9b811a241dbaec8605cc70cb2961c (patch)
tree134053c539411050f1dc765f0d15bef8c412cb7b
parent219c38b9217d6dbb1621c27f64e9bf86bf92ec19 (diff)
Fix missing `isCancel` (#19354)
-rw-r--r--app/javascript/mastodon/actions/compose.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/javascript/mastodon/actions/compose.js b/app/javascript/mastodon/actions/compose.js
index da11a9d5a..0cfc1868e 100644
--- a/app/javascript/mastodon/actions/compose.js
+++ b/app/javascript/mastodon/actions/compose.js
@@ -1,4 +1,4 @@
-import { isCancel } from 'axios';
+import axios from 'axios';
 import { throttle } from 'lodash';
 import { defineMessages } from 'react-intl';
 import api from 'mastodon/api';
@@ -462,9 +462,11 @@ const fetchComposeSuggestionsAccounts = throttle((dispatch, getState, token) =>
     dispatch(importFetchedAccounts(response.data));
     dispatch(readyComposeSuggestionsAccounts(token, response.data));
   }).catch(error => {
-    if (!isCancel(error)) {
+    if (!axios.isCancel(error)) {
       dispatch(showAlertForError(error));
     }
+  }).finally(() => {
+    fetchComposeSuggestionsAccountsController = undefined;
   });
 }, 200, { leading: true, trailing: true });
 
@@ -495,9 +497,11 @@ const fetchComposeSuggestionsTags = throttle((dispatch, getState, token) => {
   }).then(({ data }) => {
     dispatch(readyComposeSuggestionsTags(token, data.hashtags));
   }).catch(error => {
-    if (!isCancel(error)) {
+    if (!axios.isCancel(error)) {
       dispatch(showAlertForError(error));
     }
+  }).finally(() => {
+    fetchComposeSuggestionsTagsController = undefined;
   });
 }, 200, { leading: true, trailing: true });