diff --git a/invokeai/frontend/web/src/common/components/Picker/Picker.tsx b/invokeai/frontend/web/src/common/components/Picker/Picker.tsx index e3c0d35e10..d0e3271c31 100644 --- a/invokeai/frontend/web/src/common/components/Picker/Picker.tsx +++ b/invokeai/frontend/web/src/common/components/Picker/Picker.tsx @@ -201,7 +201,7 @@ type PickerProps = { /** * Initial state for group toggles. If provided, groups will start with these states instead of all being disabled. */ - initialGroupStates?: Record; + initialGroupStates?: GroupStatusMap; }; export type PickerContextState = { @@ -314,12 +314,9 @@ const flattenOptions = (options: OptionOrGroup[]): T[] => { return flattened; }; -type GroupStatusMap = Record; +export type GroupStatusMap = Record; -const useTogglableGroups = ( - options: OptionOrGroup[], - initialGroupStates?: Record -) => { +const useTogglableGroups = (options: OptionOrGroup[], initialGroupStates?: GroupStatusMap) => { const groupsWithOptions = useMemo(() => { const ids: string[] = []; for (const optionOrGroup of options) { diff --git a/invokeai/frontend/web/src/features/lora/components/LoRASelect.tsx b/invokeai/frontend/web/src/features/lora/components/LoRASelect.tsx index 4ab04783df..293acde364 100644 --- a/invokeai/frontend/web/src/features/lora/components/LoRASelect.tsx +++ b/invokeai/frontend/web/src/features/lora/components/LoRASelect.tsx @@ -2,6 +2,7 @@ import { FormControl, FormLabel } from '@invoke-ai/ui-library'; import { createSelector } from '@reduxjs/toolkit'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover'; +import type { GroupStatusMap } from 'common/components/Picker/Picker'; import { useRelatedGroupedModelCombobox } from 'common/hooks/useRelatedGroupedModelCombobox'; import { loraAdded, selectLoRAsSlice } from 'features/controlLayers/store/lorasSlice'; import { selectBase } from 'features/controlLayers/store/paramsSlice'; @@ -69,7 +70,7 @@ const LoRASelect = () => { const groupId = API_BASE_MODELS.includes(currentBaseModel) ? 'api' : currentBaseModel; // Return a map with only the current base model group enabled - return { [groupId]: true }; + return { [groupId]: true } satisfies GroupStatusMap; }, [currentBaseModel]); return (