From 0712cc2b99c8feec3a43d6c288781137d9efbe39 Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Tue, 12 Sep 2023 12:18:19 +0200 Subject: [PATCH] Fix Redux types (#26899) --- app/javascript/mastodon/store/middlewares/errors.ts | 2 +- app/javascript/mastodon/store/middlewares/loading_bar.ts | 2 +- app/javascript/mastodon/store/middlewares/sounds.ts | 5 +---- app/javascript/mastodon/store/typed_functions.ts | 1 - 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/javascript/mastodon/store/middlewares/errors.ts b/app/javascript/mastodon/store/middlewares/errors.ts index 4e720bfed4..9f28f5ff53 100644 --- a/app/javascript/mastodon/store/middlewares/errors.ts +++ b/app/javascript/mastodon/store/middlewares/errors.ts @@ -5,7 +5,7 @@ import { showAlertForError } from '../../actions/alerts'; const defaultFailSuffix = 'FAIL'; -export const errorsMiddleware: Middleware, RootState> = +export const errorsMiddleware: Middleware = ({ dispatch }) => (next) => (action: AnyAction & { skipAlert?: boolean; skipNotFound?: boolean }) => { diff --git a/app/javascript/mastodon/store/middlewares/loading_bar.ts b/app/javascript/mastodon/store/middlewares/loading_bar.ts index 379b3758a1..5fe8000731 100644 --- a/app/javascript/mastodon/store/middlewares/loading_bar.ts +++ b/app/javascript/mastodon/store/middlewares/loading_bar.ts @@ -15,7 +15,7 @@ const defaultTypeSuffixes: Config['promiseTypeSuffixes'] = [ export const loadingBarMiddleware = ( config: Config = {}, -): Middleware, RootState> => { +): Middleware => { const promiseTypeSuffixes = config.promiseTypeSuffixes ?? defaultTypeSuffixes; return ({ dispatch }) => diff --git a/app/javascript/mastodon/store/middlewares/sounds.ts b/app/javascript/mastodon/store/middlewares/sounds.ts index 092f403f5f..09ade7d753 100644 --- a/app/javascript/mastodon/store/middlewares/sounds.ts +++ b/app/javascript/mastodon/store/middlewares/sounds.ts @@ -34,10 +34,7 @@ const play = (audio: HTMLAudioElement) => { void audio.play(); }; -export const soundsMiddleware = (): Middleware< - Record, - RootState -> => { +export const soundsMiddleware = (): Middleware => { const soundCache: Record = {}; void ready(() => { diff --git a/app/javascript/mastodon/store/typed_functions.ts b/app/javascript/mastodon/store/typed_functions.ts index d05a256bab..f1e71385a8 100644 --- a/app/javascript/mastodon/store/typed_functions.ts +++ b/app/javascript/mastodon/store/typed_functions.ts @@ -12,5 +12,4 @@ export const createAppAsyncThunk = createAsyncThunk.withTypes<{ state: RootState; dispatch: AppDispatch; rejectValue: string; - extra: { s: string; n: number }; }>();