diff --git a/client/src/actions/embedding.ts b/client/src/actions/embedding.ts index 757721e6c..fc09e9ace 100644 --- a/client/src/actions/embedding.ts +++ b/client/src/actions/embedding.ts @@ -30,32 +30,30 @@ export async function _switchEmbedding( return [annoMatrix, obsCrossfilter]; } -export const layoutChoiceAction = - ( - newLayoutChoice: any // eslint-disable-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS. - ) => +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS. +export const layoutChoiceAction = (newLayoutChoice: any) => async ( // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS. - async ( - // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS. - dispatch: any, - // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS. - getState: any - ) => { - /* + dispatch: any, + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS. + getState: any +) => { + /* On layout choice, make sure we have selected all on the previous layout, AND the new layout. */ - const { annoMatrix: prevAnnoMatrix, obsCrossfilter: prevCrossfilter } = - getState(); - const [annoMatrix, obsCrossfilter] = await _switchEmbedding( - prevAnnoMatrix, - prevCrossfilter, - newLayoutChoice - ); - dispatch({ - type: "set layout choice", - layoutChoice: newLayoutChoice, - obsCrossfilter, - annoMatrix, - }); - }; + const { + annoMatrix: prevAnnoMatrix, + obsCrossfilter: prevCrossfilter, + } = getState(); + const [annoMatrix, obsCrossfilter] = await _switchEmbedding( + prevAnnoMatrix, + prevCrossfilter, + newLayoutChoice + ); + dispatch({ + type: "set layout choice", + layoutChoice: newLayoutChoice, + obsCrossfilter, + annoMatrix, + }); +};