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 }));
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;
}
const { width, height } = calculateNewSize(

View File

@ -11,7 +11,9 @@ const selectEntityIds = createMemoizedSelector(selectCanvasV2Slice, (canvasV2) =
});
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);
if (layerIds.length === 0) {

View File

@ -11,7 +11,9 @@ const selectEntityIds = createMemoizedSelector(selectCanvasV2Slice, (canvasV2) =
});
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);
if (entityIds.length === 0) {

View File

@ -11,7 +11,9 @@ const selectEntityIds = createMemoizedSelector(selectCanvasV2Slice, (canvasV2) =
});
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);
if (layerIds.length === 0) {

View File

@ -11,7 +11,9 @@ const selectEntityIds = createMemoizedSelector(selectCanvasV2Slice, (canvasV2) =
});
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);
if (rgIds.length === 0) {

View File

@ -18,7 +18,9 @@ export const RegionalGuidanceSettings = memo(() => {
const hasNegativePrompt = useAppSelector(
(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 (
<CanvasEntitySettingsWrapper>

View File

@ -242,7 +242,12 @@ export const buildSD1Graph = async (
type: 'collect',
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(
manager,

View File

@ -245,7 +245,12 @@ export const buildSDXLGraph = async (
type: 'collect',
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(
manager,