chore(ui): lint

This commit is contained in:
psychedelicious
2024-08-26 22:57:56 +10:00
parent ea267c0e09
commit 434afdd21d
8 changed files with 34 additions and 8 deletions

View File

@ -83,7 +83,13 @@ const handleMainModels: ModelHandler = (models, state, dispatch, log) => {
dispatch(modelChanged({ model: defaultModelInList, previousModel: currentModel })); dispatch(modelChanged({ model: defaultModelInList, previousModel: currentModel }));
const optimalDimension = getOptimalDimension(defaultModelInList); const optimalDimension = getOptimalDimension(defaultModelInList);
if (getIsSizeOptimal(state.canvasV2.present.bbox.rect.width, state.canvasV2.present.bbox.rect.height, optimalDimension)) { if (
getIsSizeOptimal(
state.canvasV2.present.bbox.rect.width,
state.canvasV2.present.bbox.rect.height,
optimalDimension
)
) {
return; return;
} }
const { width, height } = calculateNewSize( const { width, height } = calculateNewSize(

View File

@ -11,7 +11,9 @@ const selectEntityIds = createMemoizedSelector(selectCanvasV2Slice, (canvasV2) =
}); });
export const ControlLayerEntityList = memo(() => { export const ControlLayerEntityList = memo(() => {
const isSelected = useAppSelector((s) => Boolean(s.canvasV2.present.selectedEntityIdentifier?.type === 'control_layer')); const isSelected = useAppSelector((s) =>
Boolean(s.canvasV2.present.selectedEntityIdentifier?.type === 'control_layer')
);
const layerIds = useAppSelector(selectEntityIds); const layerIds = useAppSelector(selectEntityIds);
if (layerIds.length === 0) { if (layerIds.length === 0) {

View File

@ -11,7 +11,9 @@ const selectEntityIds = createMemoizedSelector(selectCanvasV2Slice, (canvasV2) =
}); });
export const InpaintMaskList = memo(() => { export const InpaintMaskList = memo(() => {
const isSelected = useAppSelector((s) => Boolean(s.canvasV2.present.selectedEntityIdentifier?.type === 'inpaint_mask')); const isSelected = useAppSelector((s) =>
Boolean(s.canvasV2.present.selectedEntityIdentifier?.type === 'inpaint_mask')
);
const entityIds = useAppSelector(selectEntityIds); const entityIds = useAppSelector(selectEntityIds);
if (entityIds.length === 0) { if (entityIds.length === 0) {

View File

@ -11,7 +11,9 @@ const selectEntityIds = createMemoizedSelector(selectCanvasV2Slice, (canvasV2) =
}); });
export const RasterLayerEntityList = memo(() => { export const RasterLayerEntityList = memo(() => {
const isSelected = useAppSelector((s) => Boolean(s.canvasV2.present.selectedEntityIdentifier?.type === 'raster_layer')); const isSelected = useAppSelector((s) =>
Boolean(s.canvasV2.present.selectedEntityIdentifier?.type === 'raster_layer')
);
const layerIds = useAppSelector(selectEntityIds); const layerIds = useAppSelector(selectEntityIds);
if (layerIds.length === 0) { if (layerIds.length === 0) {

View File

@ -11,7 +11,9 @@ const selectEntityIds = createMemoizedSelector(selectCanvasV2Slice, (canvasV2) =
}); });
export const RegionalGuidanceEntityList = memo(() => { export const RegionalGuidanceEntityList = memo(() => {
const isSelected = useAppSelector((s) => Boolean(s.canvasV2.present.selectedEntityIdentifier?.type === 'regional_guidance')); const isSelected = useAppSelector((s) =>
Boolean(s.canvasV2.present.selectedEntityIdentifier?.type === 'regional_guidance')
);
const rgIds = useAppSelector(selectEntityIds); const rgIds = useAppSelector(selectEntityIds);
if (rgIds.length === 0) { if (rgIds.length === 0) {

View File

@ -18,7 +18,9 @@ export const RegionalGuidanceSettings = memo(() => {
const hasNegativePrompt = useAppSelector( const hasNegativePrompt = useAppSelector(
(s) => selectEntityOrThrow(s.canvasV2.present, entityIdentifier).negativePrompt !== null (s) => selectEntityOrThrow(s.canvasV2.present, entityIdentifier).negativePrompt !== null
); );
const hasIPAdapters = useAppSelector((s) => selectEntityOrThrow(s.canvasV2.present, entityIdentifier).ipAdapters.length > 0); const hasIPAdapters = useAppSelector(
(s) => selectEntityOrThrow(s.canvasV2.present, entityIdentifier).ipAdapters.length > 0
);
return ( return (
<CanvasEntitySettingsWrapper> <CanvasEntitySettingsWrapper>

View File

@ -242,7 +242,12 @@ export const buildSD1Graph = async (
type: 'collect', type: 'collect',
id: getPrefixedId('ip_adapter_collector'), id: getPrefixedId('ip_adapter_collector'),
}); });
const ipAdapterResult = addIPAdapters(state.canvasV2.present.ipAdapters.entities, g, ipAdapterCollector, modelConfig.base); const ipAdapterResult = addIPAdapters(
state.canvasV2.present.ipAdapters.entities,
g,
ipAdapterCollector,
modelConfig.base
);
const regionsResult = await addRegions( const regionsResult = await addRegions(
manager, manager,

View File

@ -245,7 +245,12 @@ export const buildSDXLGraph = async (
type: 'collect', type: 'collect',
id: getPrefixedId('ip_adapter_collector'), id: getPrefixedId('ip_adapter_collector'),
}); });
const ipAdapterResult = addIPAdapters(state.canvasV2.present.ipAdapters.entities, g, ipAdapterCollector, modelConfig.base); const ipAdapterResult = addIPAdapters(
state.canvasV2.present.ipAdapters.entities,
g,
ipAdapterCollector,
modelConfig.base
);
const regionsResult = await addRegions( const regionsResult = await addRegions(
manager, manager,