From 297c8c37b11d5e1c83fa3ed0fea654ffe8aa64dc Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Tue, 2 Apr 2024 11:56:03 +0200 Subject: [PATCH] [Glitch] Fix Redux Middleware types Port 07635228e2b2182888850cecddd4b09756d9edbc to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/store/middlewares/errors.ts | 3 ++- app/javascript/flavours/glitch/store/middlewares/sounds.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/javascript/flavours/glitch/store/middlewares/errors.ts b/app/javascript/flavours/glitch/store/middlewares/errors.ts index 977a09a464..e77cec34ed 100644 --- a/app/javascript/flavours/glitch/store/middlewares/errors.ts +++ b/app/javascript/flavours/glitch/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/flavours/glitch/store/middlewares/sounds.ts b/app/javascript/flavours/glitch/store/middlewares/sounds.ts index 52d5f6b507..ab04f6c94b 100644 --- a/app/javascript/flavours/glitch/store/middlewares/sounds.ts +++ b/app/javascript/flavours/glitch/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 = {};