From c3a0d5aca3e04e7ef849b7ec05f308e840484899 Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Tue, 12 Sep 2023 12:18:19 +0200 Subject: [PATCH] [Glitch] Fix Redux types Port 0712cc2b99c8feec3a43d6c288781137d9efbe39 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/store/middlewares/errors.ts | 2 +- .../flavours/glitch/store/middlewares/loading_bar.ts | 2 +- app/javascript/flavours/glitch/store/middlewares/sounds.ts | 5 +---- app/javascript/flavours/glitch/store/typed_functions.ts | 1 - 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/javascript/flavours/glitch/store/middlewares/errors.ts b/app/javascript/flavours/glitch/store/middlewares/errors.ts index 4e720bfed4..9f28f5ff53 100644 --- a/app/javascript/flavours/glitch/store/middlewares/errors.ts +++ b/app/javascript/flavours/glitch/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/flavours/glitch/store/middlewares/loading_bar.ts b/app/javascript/flavours/glitch/store/middlewares/loading_bar.ts index 379b3758a1..5fe8000731 100644 --- a/app/javascript/flavours/glitch/store/middlewares/loading_bar.ts +++ b/app/javascript/flavours/glitch/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/flavours/glitch/store/middlewares/sounds.ts b/app/javascript/flavours/glitch/store/middlewares/sounds.ts index 48a5762d6f..3bf7d2a357 100644 --- a/app/javascript/flavours/glitch/store/middlewares/sounds.ts +++ b/app/javascript/flavours/glitch/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/flavours/glitch/store/typed_functions.ts b/app/javascript/flavours/glitch/store/typed_functions.ts index d05a256bab..f1e71385a8 100644 --- a/app/javascript/flavours/glitch/store/typed_functions.ts +++ b/app/javascript/flavours/glitch/store/typed_functions.ts @@ -12,5 +12,4 @@ export const createAppAsyncThunk = createAsyncThunk.withTypes<{ state: RootState; dispatch: AppDispatch; rejectValue: string; - extra: { s: string; n: number }; }>();