fix(ui): delete control layers correctly

This commit is contained in:
psychedelicious 2024-04-30 10:40:23 +10:00 committed by Kent Keirsey
parent c1666a8b5a
commit 629110784d

View File

@ -1,6 +1,6 @@
import { IconButton } from '@invoke-ai/ui-library'; import { IconButton } from '@invoke-ai/ui-library';
import { guidanceLayerDeleted } from 'app/store/middleware/listenerMiddleware/listeners/regionalControlToControlAdapterBridge';
import { useAppDispatch } from 'app/store/storeHooks'; import { useAppDispatch } from 'app/store/storeHooks';
import { layerDeleted } from 'features/regionalPrompts/store/regionalPromptsSlice';
import { memo, useCallback } from 'react'; import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { PiTrashSimpleBold } from 'react-icons/pi'; import { PiTrashSimpleBold } from 'react-icons/pi';
@ -11,7 +11,7 @@ export const RPLayerDeleteButton = memo(({ layerId }: Props) => {
const { t } = useTranslation(); const { t } = useTranslation();
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
const deleteLayer = useCallback(() => { const deleteLayer = useCallback(() => {
dispatch(layerDeleted(layerId)); dispatch(guidanceLayerDeleted(layerId));
}, [dispatch, layerId]); }, [dispatch, layerId]);
return ( return (
<IconButton <IconButton