mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
chore(ui): lint
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { useAppSelector } from 'app/store/storeHooks';
|
||||
import { selectNode, selectNodesSlice } from 'features/nodes/store/selectors';
|
||||
import { isInvocationNode as _isInvocationNode } from 'features/nodes/types/invocation';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
export const useNodeIsInvocationNode = (nodeId: string): boolean => {
|
||||
const selector = useMemo(
|
||||
() =>
|
||||
createSelector(selectNodesSlice, (nodes) => {
|
||||
const node = selectNode(nodes, nodeId);
|
||||
return _isInvocationNode(node);
|
||||
}),
|
||||
[nodeId]
|
||||
);
|
||||
|
||||
const isInvocationNode = useAppSelector(selector);
|
||||
|
||||
return isInvocationNode;
|
||||
};
|
||||
@@ -27,11 +27,6 @@ export const selectInvocationNodeSafe = (nodesSlice: NodesState, nodeId: string)
|
||||
return node;
|
||||
};
|
||||
|
||||
export const selectInvocationNodeType = (nodesSlice: NodesState, nodeId: string): string => {
|
||||
const node = selectInvocationNode(nodesSlice, nodeId);
|
||||
return node.data.type;
|
||||
};
|
||||
|
||||
export const selectNodeData = (nodesSlice: NodesState, nodeId: string): InvocationNodeData => {
|
||||
const node = selectInvocationNode(nodesSlice, nodeId);
|
||||
return node.data;
|
||||
|
||||
Reference in New Issue
Block a user