diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f7e2e5803..7f1bcf1122 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Datepicker: correctly default to the current year. - Scheduled posts: fix page crashing on deleting a scheduled post. - Events: don't crash when searching for a location. +- Search: fixes an abort error when using the navbar search component. ## [3.0.0] - 2022-12-25 diff --git a/app/soapbox/actions/me.ts b/app/soapbox/actions/me.ts index 7a7cf18d99..a8b2752005 100644 --- a/app/soapbox/actions/me.ts +++ b/app/soapbox/actions/me.ts @@ -6,7 +6,7 @@ import api from '../api'; import { loadCredentials } from './auth'; import { importFetchedAccount } from './importer'; -import type { AxiosError, AxiosRequestHeaders } from 'axios'; +import type { AxiosError, RawAxiosRequestHeaders } from 'axios'; import type { AppDispatch, RootState } from 'soapbox/store'; import type { APIEntity } from 'soapbox/types/entities'; @@ -66,7 +66,7 @@ const patchMe = (params: Record, isFormData = false) => (dispatch: AppDispatch, getState: () => RootState) => { dispatch(patchMeRequest()); - const headers: AxiosRequestHeaders = isFormData ? { + const headers: RawAxiosRequestHeaders = isFormData ? { 'Content-Type': 'multipart/form-data', } : {}; diff --git a/app/soapbox/components/autosuggest-account-input.tsx b/app/soapbox/components/autosuggest-account-input.tsx index dc05b8be21..383bf75830 100644 --- a/app/soapbox/components/autosuggest-account-input.tsx +++ b/app/soapbox/components/autosuggest-account-input.tsx @@ -44,7 +44,7 @@ const AutosuggestAccountInput: React.FC = ({ setAccountIds(ImmutableOrderedSet()); }; - const handleAccountSearch = useCallback(throttle(q => { + const handleAccountSearch = useCallback(throttle((q) => { const params = { q, limit, resolve: false }; dispatch(accountSearch(params, controller.current.signal)) @@ -53,7 +53,7 @@ const AutosuggestAccountInput: React.FC = ({ setAccountIds(ImmutableOrderedSet(accountIds)); }) .catch(noOp); - }, 900, { leading: false, trailing: true }), [limit]); + }, 900, { leading: true, trailing: true }), [limit]); const handleChange: React.ChangeEventHandler = e => { refreshCancelToken(); diff --git a/package.json b/package.json index d24aee60ea..94f0d285bd 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "@types/webpack-deadcode-plugin": "^0.1.2", "array-includes": "^3.1.5", "autoprefixer": "^10.4.2", - "axios": "^1.0.0-alpha.1", + "axios": "^1.2.2", "axios-mock-adapter": "^1.21.1", "babel-loader": "^8.2.5", "babel-plugin-lodash": "^3.3.4", diff --git a/yarn.lock b/yarn.lock index d7f29debab..1f1590f0d2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3658,10 +3658,10 @@ axios-mock-adapter@^1.21.1: fast-deep-equal "^3.1.3" is-buffer "^2.0.5" -axios@^1.0.0-alpha.1: - version "1.0.0-alpha.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.0.0-alpha.1.tgz#ce69c17ca7605d01787ca754dd906e6fccdf71ee" - integrity sha512-p+meG161943WT+K7sJYquHR46xxi/z0tk7vnSmEf/LrfEAyiP+0uTMMYk1OEo1IRF18oGRhnFxN1y8fLcXaTMw== +axios@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.2.2.tgz#72681724c6e6a43a9fea860fc558127dbe32f9f1" + integrity sha512-bz/J4gS2S3I7mpN/YZfGFTqhXTYzRho8Ay38w2otuuDR322KzFIWm/4W2K6gIwvWaws5n+mnb7D1lN9uD+QH6Q== dependencies: follow-redirects "^1.15.0" form-data "^4.0.0"