mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): ip adapter layers always at bottom of list
This commit is contained in:
parent
6195741814
commit
9d042baf48
@ -8,13 +8,15 @@ import { ControlAdapterLayerListItem } from 'features/regionalPrompts/components
|
|||||||
import { DeleteAllLayersButton } from 'features/regionalPrompts/components/DeleteAllLayersButton';
|
import { DeleteAllLayersButton } from 'features/regionalPrompts/components/DeleteAllLayersButton';
|
||||||
import { IPAdapterLayerListItem } from 'features/regionalPrompts/components/IPAdapterLayerListItem';
|
import { IPAdapterLayerListItem } from 'features/regionalPrompts/components/IPAdapterLayerListItem';
|
||||||
import { MaskedGuidanceLayerListItem } from 'features/regionalPrompts/components/MaskedGuidanceLayerListItem';
|
import { MaskedGuidanceLayerListItem } from 'features/regionalPrompts/components/MaskedGuidanceLayerListItem';
|
||||||
import { selectRegionalPromptsSlice } from 'features/regionalPrompts/store/regionalPromptsSlice';
|
import { isRenderableLayer, selectRegionalPromptsSlice } from 'features/regionalPrompts/store/regionalPromptsSlice';
|
||||||
import type { Layer } from 'features/regionalPrompts/store/types';
|
import type { Layer } from 'features/regionalPrompts/store/types';
|
||||||
|
import { partition } from 'lodash-es';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
|
|
||||||
const selectLayerIdTypePairs = createMemoizedSelector(selectRegionalPromptsSlice, (regionalPrompts) =>
|
const selectLayerIdTypePairs = createMemoizedSelector(selectRegionalPromptsSlice, (regionalPrompts) => {
|
||||||
regionalPrompts.present.layers.map((l) => ({ id: l.id, type: l.type })).reverse()
|
const [renderableLayers, ipAdapterLayers] = partition(regionalPrompts.present.layers, isRenderableLayer);
|
||||||
);
|
return [...ipAdapterLayers, ...renderableLayers].map((l) => ({ id: l.id, type: l.type })).reverse();
|
||||||
|
});
|
||||||
|
|
||||||
export const RegionalPromptsPanelContent = memo(() => {
|
export const RegionalPromptsPanelContent = memo(() => {
|
||||||
const layerIdTypePairs = useAppSelector(selectLayerIdTypePairs);
|
const layerIdTypePairs = useAppSelector(selectLayerIdTypePairs);
|
||||||
|
Loading…
Reference in New Issue
Block a user