fix(ui): update workflow selectors

This commit is contained in:
psychedelicious 2024-01-05 22:27:54 +11:00
parent 73481d4aec
commit b71b14d582

View File

@ -1,12 +1,12 @@
import type { Modifier } from '@dnd-kit/core'; import type { Modifier } from '@dnd-kit/core';
import { getEventCoordinates } from '@dnd-kit/utilities'; import { getEventCoordinates } from '@dnd-kit/utilities';
import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { createSelector } from '@reduxjs/toolkit';
import { useAppSelector } from 'app/store/storeHooks'; import { useAppSelector } from 'app/store/storeHooks';
import { selectNodesSlice } from 'features/nodes/store/nodesSlice'; import { selectNodesSlice } from 'features/nodes/store/nodesSlice';
import { activeTabNameSelector } from 'features/ui/store/uiSelectors'; import { activeTabNameSelector } from 'features/ui/store/uiSelectors';
import { useCallback } from 'react'; import { useCallback } from 'react';
const selectZoom = createMemoizedSelector( const selectZoom = createSelector(
[selectNodesSlice, activeTabNameSelector], [selectNodesSlice, activeTabNameSelector],
(nodes, activeTabName) => (nodes, activeTabName) =>
activeTabName === 'nodes' ? nodes.viewport.zoom : 1 activeTabName === 'nodes' ? nodes.viewport.zoom : 1