|
@ -1,5 +1,5 @@ |
|
|
import api from 'flavours/glitch/util/api'; |
|
|
import api from 'flavours/glitch/util/api'; |
|
|
import { CancelToken } from 'axios'; |
|
|
|
|
|
|
|
|
import { CancelToken, isCancel } from 'axios'; |
|
|
import { throttle } from 'lodash'; |
|
|
import { throttle } from 'lodash'; |
|
|
import { search as emojiSearch } from 'flavours/glitch/util/emoji/emoji_mart_search_light'; |
|
|
import { search as emojiSearch } from 'flavours/glitch/util/emoji/emoji_mart_search_light'; |
|
|
import { useEmoji } from './emojis'; |
|
|
import { useEmoji } from './emojis'; |
|
@ -8,6 +8,7 @@ import { recoverHashtags } from 'flavours/glitch/util/hashtag'; |
|
|
import resizeImage from 'flavours/glitch/util/resize_image'; |
|
|
import resizeImage from 'flavours/glitch/util/resize_image'; |
|
|
|
|
|
|
|
|
import { updateTimeline } from './timelines'; |
|
|
import { updateTimeline } from './timelines'; |
|
|
|
|
|
import { showAlertForError } from './alerts'; |
|
|
|
|
|
|
|
|
let cancelFetchComposeSuggestionsAccounts; |
|
|
let cancelFetchComposeSuggestionsAccounts; |
|
|
|
|
|
|
|
@ -320,6 +321,10 @@ const fetchComposeSuggestionsAccounts = throttle((dispatch, getState, token) => |
|
|
}, |
|
|
}, |
|
|
}).then(response => { |
|
|
}).then(response => { |
|
|
dispatch(readyComposeSuggestionsAccounts(token, response.data)); |
|
|
dispatch(readyComposeSuggestionsAccounts(token, response.data)); |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
if (!isCancel(error)) { |
|
|
|
|
|
dispatch(showAlertForError(error)); |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
}, 200, { leading: true, trailing: true }); |
|
|
}, 200, { leading: true, trailing: true }); |
|
|
|
|
|
|
|
|