File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
invokeai/frontend/web/src Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -201,7 +201,7 @@ type PickerProps<T extends object> = {
201
201
/**
202
202
* Initial state for group toggles. If provided, groups will start with these states instead of all being disabled.
203
203
*/
204
- initialGroupStates ?: Record < string , boolean > ;
204
+ initialGroupStates ?: GroupStatusMap ;
205
205
} ;
206
206
207
207
export type PickerContextState < T extends object > = {
@@ -314,12 +314,9 @@ const flattenOptions = <T extends object>(options: OptionOrGroup<T>[]): T[] => {
314
314
return flattened ;
315
315
} ;
316
316
317
- type GroupStatusMap = Record < string , boolean > ;
317
+ export type GroupStatusMap = Record < string , boolean > ;
318
318
319
- const useTogglableGroups = < T extends object > (
320
- options : OptionOrGroup < T > [ ] ,
321
- initialGroupStates ?: Record < string , boolean >
322
- ) => {
319
+ const useTogglableGroups = < T extends object > ( options : OptionOrGroup < T > [ ] , initialGroupStates ?: GroupStatusMap ) => {
323
320
const groupsWithOptions = useMemo ( ( ) => {
324
321
const ids : string [ ] = [ ] ;
325
322
for ( const optionOrGroup of options ) {
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { FormControl, FormLabel } from '@invoke-ai/ui-library';
2
2
import { createSelector } from '@reduxjs/toolkit' ;
3
3
import { useAppDispatch , useAppSelector } from 'app/store/storeHooks' ;
4
4
import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover' ;
5
+ import type { GroupStatusMap } from 'common/components/Picker/Picker' ;
5
6
import { useRelatedGroupedModelCombobox } from 'common/hooks/useRelatedGroupedModelCombobox' ;
6
7
import { loraAdded , selectLoRAsSlice } from 'features/controlLayers/store/lorasSlice' ;
7
8
import { selectBase } from 'features/controlLayers/store/paramsSlice' ;
@@ -69,7 +70,7 @@ const LoRASelect = () => {
69
70
const groupId = API_BASE_MODELS . includes ( currentBaseModel ) ? 'api' : currentBaseModel ;
70
71
71
72
// Return a map with only the current base model group enabled
72
- return { [ groupId ] : true } ;
73
+ return { [ groupId ] : true } satisfies GroupStatusMap ;
73
74
} , [ currentBaseModel ] ) ;
74
75
75
76
return (
You can’t perform that action at this time.
0 commit comments