about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2022-10-14 23:14:22 +0900
committerClaire <claire.github-309c@sitedethib.com>2022-10-28 19:24:02 +0200
commit39ec0e8398def877572c8a489ae32473f449a8b3 (patch)
tree6dde0a5aa90aace26e4441c2c0ca69d31d032af5 /app
parente301cfb4637ff0ef75de066d929d52c39ddfb7ea (diff)
[Glitch] Fix missing `isCancel`
Port e02bdc14fdf9b811a241dbaec8605cc70cb2961c to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app')
-rw-r--r--app/javascript/flavours/glitch/actions/compose.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/javascript/flavours/glitch/actions/compose.js b/app/javascript/flavours/glitch/actions/compose.js
index 56a3b7b5f..e68ba9c67 100644
--- a/app/javascript/flavours/glitch/actions/compose.js
+++ b/app/javascript/flavours/glitch/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 'flavours/glitch/api';
@@ -501,9 +501,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 });
 
@@ -533,9 +535,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 });