mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
tidy(ui): minor ca component tidy
This commit is contained in:
committed by
Kent Keirsey
parent
6f5f3381f9
commit
ebeae41cb2
@@ -5,15 +5,15 @@ import {
|
||||
selectControlAdaptersSlice,
|
||||
} from 'features/controlAdapters/store/controlAdaptersSlice';
|
||||
import { useMemo } from 'react';
|
||||
import { assert } from 'tsafe';
|
||||
|
||||
export const useControlAdapterIPMethod = (id: string) => {
|
||||
const selector = useMemo(
|
||||
() =>
|
||||
createMemoizedSelector(selectControlAdaptersSlice, (controlAdapters) => {
|
||||
const cn = selectControlAdapterById(controlAdapters, id);
|
||||
if (cn && cn?.type === 'ip_adapter') {
|
||||
return cn.method;
|
||||
}
|
||||
const ca = selectControlAdapterById(controlAdapters, id);
|
||||
assert(ca?.type === 'ip_adapter');
|
||||
return ca.method;
|
||||
}),
|
||||
[id]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user