mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-01 12:24:57 -05:00
fix(ui): useIsEntityTypeEnabled should use useMemo not useCallback
Typo/bug introduced in #7770
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
import { useAppSelector } from 'app/store/storeHooks';
|
import { useAppSelector } from 'app/store/storeHooks';
|
||||||
import { selectIsCogView4, selectIsSD3 } from 'features/controlLayers/store/paramsSlice';
|
import { selectIsCogView4, selectIsSD3 } from 'features/controlLayers/store/paramsSlice';
|
||||||
import type { CanvasEntityType } from 'features/controlLayers/store/types';
|
import type { CanvasEntityType } from 'features/controlLayers/store/types';
|
||||||
import { useCallback } from 'react';
|
import { useMemo } from 'react';
|
||||||
|
|
||||||
export const useIsEntityTypeEnabled = (entityType: CanvasEntityType) => {
|
export const useIsEntityTypeEnabled = (entityType: CanvasEntityType) => {
|
||||||
const isSD3 = useAppSelector(selectIsSD3);
|
const isSD3 = useAppSelector(selectIsSD3);
|
||||||
const isCogView4 = useAppSelector(selectIsCogView4);
|
const isCogView4 = useAppSelector(selectIsCogView4);
|
||||||
|
|
||||||
const isEntityTypeEnabled = useCallback(() => {
|
const isEntityTypeEnabled = useMemo<boolean>(() => {
|
||||||
switch (entityType) {
|
switch (entityType) {
|
||||||
case 'reference_image':
|
case 'reference_image':
|
||||||
return !isSD3 && !isCogView4;
|
return !isSD3 && !isCogView4;
|
||||||
|
|||||||
Reference in New Issue
Block a user