From b476d6441ed34fca1e3eacf8174d84bd71b85a7d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 8 Sep 2023 13:28:23 -0500 Subject: [PATCH] bun: improve types so it runs with bun --- app/soapbox/__tests__/toast.test.tsx | 6 ++++-- app/soapbox/features/auth-login/components/captcha.tsx | 2 +- app/soapbox/features/home-timeline/index.tsx | 2 +- app/soapbox/utils/tailwind.ts | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/soapbox/__tests__/toast.test.tsx b/app/soapbox/__tests__/toast.test.tsx index 4c38755e2..795c11493 100644 --- a/app/soapbox/__tests__/toast.test.tsx +++ b/app/soapbox/__tests__/toast.test.tsx @@ -1,5 +1,5 @@ import { render } from '@testing-library/react'; -import { AxiosError } from 'axios'; +import { AxiosError, AxiosHeaders } from 'axios'; import React from 'react'; import { IntlProvider } from 'react-intl'; @@ -73,7 +73,9 @@ describe('toasts', () =>{ statusText: String(status), status, headers: {}, - config: {}, + config: { + headers: new AxiosHeaders(), + }, }); describe('with a 502 status code', () => { diff --git a/app/soapbox/features/auth-login/components/captcha.tsx b/app/soapbox/features/auth-login/components/captcha.tsx index 65179bea6..28f2d911f 100644 --- a/app/soapbox/features/auth-login/components/captcha.tsx +++ b/app/soapbox/features/auth-login/components/captcha.tsx @@ -38,7 +38,7 @@ const CaptchaField: React.FC = ({ const dispatch = useAppDispatch(); const [captcha, setCaptcha] = useState(ImmutableMap()); - const [refresh, setRefresh] = useState(undefined); + const [refresh, setRefresh] = useState(undefined); const getCaptcha = () => { dispatch(fetchCaptcha()).then((response: AxiosResponse) => { diff --git a/app/soapbox/features/home-timeline/index.tsx b/app/soapbox/features/home-timeline/index.tsx index 611fcf7ce..57c19b777 100644 --- a/app/soapbox/features/home-timeline/index.tsx +++ b/app/soapbox/features/home-timeline/index.tsx @@ -22,7 +22,7 @@ const HomeTimeline: React.FC = () => { const features = useFeatures(); const instance = useInstance(); - const polling = useRef(null); + const polling = useRef(null); const isPartial = useAppSelector(state => state.timelines.get('home')?.isPartial === true); const currentAccountId = useAppSelector(state => state.timelines.get('home')?.feedAccountId as string | undefined); diff --git a/app/soapbox/utils/tailwind.ts b/app/soapbox/utils/tailwind.ts index 3315a7209..2209573a5 100644 --- a/app/soapbox/utils/tailwind.ts +++ b/app/soapbox/utils/tailwind.ts @@ -50,7 +50,7 @@ export const fromLegacyColors = (soapboxConfig: SoapboxConfig): TailwindColorPal /** Convert Soapbox Config into Tailwind colors */ export const toTailwind = (soapboxConfig: SoapboxConfig): SoapboxConfig => { const colors: SoapboxColors = ImmutableMap(soapboxConfig.get('colors')); - const legacyColors: SoapboxColors = ImmutableMap(fromJS(fromLegacyColors(soapboxConfig))); + const legacyColors = ImmutableMap(fromJS(fromLegacyColors(soapboxConfig))) as SoapboxColors; return soapboxConfig.set('colors', legacyColors.mergeDeep(colors)); };