mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-25 01:24:02 -05:00
[Glitch] Fix missing isCancel
Port e02bdc14fd
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
e301cfb463
commit
39ec0e8398
@ -1,4 +1,4 @@
|
|||||||
import { isCancel } from 'axios';
|
import axios from 'axios';
|
||||||
import { throttle } from 'lodash';
|
import { throttle } from 'lodash';
|
||||||
import { defineMessages } from 'react-intl';
|
import { defineMessages } from 'react-intl';
|
||||||
import api from 'flavours/glitch/api';
|
import api from 'flavours/glitch/api';
|
||||||
@ -501,9 +501,11 @@ const fetchComposeSuggestionsAccounts = throttle((dispatch, getState, token) =>
|
|||||||
dispatch(importFetchedAccounts(response.data));
|
dispatch(importFetchedAccounts(response.data));
|
||||||
dispatch(readyComposeSuggestionsAccounts(token, response.data));
|
dispatch(readyComposeSuggestionsAccounts(token, response.data));
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
if (!isCancel(error)) {
|
if (!axios.isCancel(error)) {
|
||||||
dispatch(showAlertForError(error));
|
dispatch(showAlertForError(error));
|
||||||
}
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
fetchComposeSuggestionsAccountsController = undefined;
|
||||||
});
|
});
|
||||||
}, 200, { leading: true, trailing: true });
|
}, 200, { leading: true, trailing: true });
|
||||||
|
|
||||||
@ -533,9 +535,11 @@ const fetchComposeSuggestionsTags = throttle((dispatch, getState, token) => {
|
|||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
dispatch(readyComposeSuggestionsTags(token, data.hashtags));
|
dispatch(readyComposeSuggestionsTags(token, data.hashtags));
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
if (!isCancel(error)) {
|
if (!axios.isCancel(error)) {
|
||||||
dispatch(showAlertForError(error));
|
dispatch(showAlertForError(error));
|
||||||
}
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
fetchComposeSuggestionsTagsController = undefined;
|
||||||
});
|
});
|
||||||
}, 200, { leading: true, trailing: true });
|
}, 200, { leading: true, trailing: true });
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user