From 07635228e2b2182888850cecddd4b09756d9edbc Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Tue, 2 Apr 2024 11:56:03 +0200 Subject: [PATCH] Fix Redux Middleware types (#29800) --- app/javascript/mastodon/store/middlewares/errors.ts | 3 ++- app/javascript/mastodon/store/middlewares/sounds.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/store/middlewares/errors.ts b/app/javascript/mastodon/store/middlewares/errors.ts index 977a09a464..e77cec34ed 100644 --- a/app/javascript/mastodon/store/middlewares/errors.ts +++ b/app/javascript/mastodon/store/middlewares/errors.ts @@ -30,7 +30,8 @@ function isActionWithmaybeAlertParams( return isAction(action); } -export const errorsMiddleware: Middleware, RootState> = +// eslint-disable-next-line @typescript-eslint/ban-types -- we need to use `{}` here to ensure the dispatch types can be merged +export const errorsMiddleware: Middleware<{}, RootState> = ({ dispatch }) => (next) => (action) => { diff --git a/app/javascript/mastodon/store/middlewares/sounds.ts b/app/javascript/mastodon/store/middlewares/sounds.ts index 51839f427a..720ee163e9 100644 --- a/app/javascript/mastodon/store/middlewares/sounds.ts +++ b/app/javascript/mastodon/store/middlewares/sounds.ts @@ -51,7 +51,8 @@ const play = (audio: HTMLAudioElement) => { }; export const soundsMiddleware = (): Middleware< - Record, + // eslint-disable-next-line @typescript-eslint/ban-types -- we need to use `{}` here to ensure the dispatch types can be merged + {}, RootState > => { const soundCache: Record = {};