diff --git a/packages/desktop-client/src/hooks/useSplitsExpanded.tsx b/packages/desktop-client/src/hooks/useSplitsExpanded.tsx index ed5ca765cd5..10728ec34b7 100644 --- a/packages/desktop-client/src/hooks/useSplitsExpanded.tsx +++ b/packages/desktop-client/src/hooks/useSplitsExpanded.tsx @@ -1,15 +1,19 @@ -import { SplitMode, SplitState } from 'loot-core/client/state-types/app'; import React, { createContext, useMemo, useEffect, useContext, useReducer, - Dispatch, - ReactNode, + type Dispatch, + type ReactNode, } from 'react'; import { useSelector, useDispatch } from 'react-redux'; +import { + type SplitMode, + type SplitState, +} from 'loot-core/client/state-types/app'; + type ToggleSplitAction = { type: 'toggle-split'; id: string; @@ -60,7 +64,7 @@ const SplitsExpandedContext = createContext({ }, dispatch: () => { throw new Error('Unitialised context method called: dispatch'); - } + }, }); export function useSplitsExpanded() { @@ -83,7 +87,10 @@ type SplitsExpandedProviderProps = { initialMode: SplitMode; }; -export function SplitsExpandedProvider({ children, initialMode = 'expand' }: SplitsExpandedProviderProps) { +export function SplitsExpandedProvider({ + children, + initialMode = 'expand', +}: SplitsExpandedProviderProps) { const cachedState = useSelector(state => state.app.lastSplitState); const reduxDispatch = useDispatch(); @@ -145,7 +152,11 @@ export function SplitsExpandedProvider({ children, initialMode = 'expand' }: Spl return { ...state, transitionId: null }; } }, - cachedState.current || { ids: new Set(), mode: initialMode, transitionId: null }, + cachedState.current || { + ids: new Set(), + mode: initialMode, + transitionId: null, + }, ); useEffect(() => { diff --git a/packages/loot-core/src/client/state-types/app.d.ts b/packages/loot-core/src/client/state-types/app.d.ts index c4ba033f981..fd4e4f34414 100644 --- a/packages/loot-core/src/client/state-types/app.d.ts +++ b/packages/loot-core/src/client/state-types/app.d.ts @@ -2,7 +2,11 @@ import type { UndoState } from '../../server/undo'; import type * as constants from '../constants'; export type SplitMode = 'collapse' | 'expand'; -export type SplitState = { ids: Set; mode: SplitMode; transitionId: string | null }; +export type SplitState = { + ids: Set; + mode: SplitMode; + transitionId: string | null; +}; export type AppState = { loadingText: string | null;