From e936b1ff8fe34d3a665c55cf730fa8b997089c9c Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 18 Jun 2024 17:24:35 +1000 Subject: [PATCH] perf(ui): memoize layeractionsmenu valid actions --- .../controlLayers/components/Layer/LayerActionsMenu.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/web/src/features/controlLayers/components/Layer/LayerActionsMenu.tsx b/invokeai/frontend/web/src/features/controlLayers/components/Layer/LayerActionsMenu.tsx index a9ebc599be..5498ba6ade 100644 --- a/invokeai/frontend/web/src/features/controlLayers/components/Layer/LayerActionsMenu.tsx +++ b/invokeai/frontend/web/src/features/controlLayers/components/Layer/LayerActionsMenu.tsx @@ -1,5 +1,5 @@ import { Menu, MenuItem, MenuList } from '@invoke-ai/ui-library'; -import { createAppSelector } from 'app/store/createMemoizedSelector'; +import { createMemoizedAppSelector } from 'app/store/createMemoizedSelector'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { CanvasEntityMenuButton } from 'features/controlLayers/components/common/CanvasEntityMenuButton'; import { @@ -25,7 +25,7 @@ type Props = { id: string; }; -const selectValidActions = createAppSelector([selectCanvasV2Slice, (canvasV2, id: string) => id], (canvasV2, id) => { +const selectValidActions = createMemoizedAppSelector([selectCanvasV2Slice, (canvasV2, id: string) => id], (canvasV2, id) => { const layer = selectLayerOrThrow(canvasV2, id); const layerIndex = canvasV2.layers.indexOf(layer); const layerCount = canvasV2.layers.length;