chore(ui): lint

This commit is contained in:
psychedelicious 2024-01-28 19:56:19 +11:00
parent f5d0721fa8
commit 2f345d1976
8 changed files with 26 additions and 26 deletions

View File

@ -76,11 +76,11 @@ const IAICanvasGrid = () => {
};
const // find the x & y size of the grid
xSize = gridFullRect.x2 - gridFullRect.x1,
ySize = gridFullRect.y2 - gridFullRect.y1,
// compute the number of steps required on each axis.
xSteps = Math.round(xSize / gridSpacing) + 1,
ySteps = Math.round(ySize / gridSpacing) + 1;
xSize = gridFullRect.x2 - gridFullRect.x1;
const ySize = gridFullRect.y2 - gridFullRect.y1;
// compute the number of steps required on each axis.
const xSteps = Math.round(xSize / gridSpacing) + 1;
const ySteps = Math.round(ySize / gridSpacing) + 1;
const strokeWidth = unscale(1);

View File

@ -13,10 +13,10 @@ const AddModels = () => {
return (
<Flex flexDirection="column" width="100%" overflow="scroll" maxHeight={window.innerHeight - 250} gap={4}>
<ButtonGroup>
<Button size="sm" isChecked={addModelMode == 'simple'} onClick={handleAddModelSimple}>
<Button size="sm" isChecked={addModelMode === 'simple'} onClick={handleAddModelSimple}>
{t('common.simple')}
</Button>
<Button size="sm" isChecked={addModelMode == 'advanced'} onClick={handleAddModelAdvanced}>
<Button size="sm" isChecked={addModelMode === 'advanced'} onClick={handleAddModelAdvanced}>
{t('common.advanced')}
</Button>
</ButtonGroup>

View File

@ -17,16 +17,16 @@ const ImportModelsPanel = () => {
return (
<Flex flexDirection="column" gap={4} h="full">
<ButtonGroup>
<Button onClick={handleClickAddTab} isChecked={addModelTab == 'add'} size="sm" width="100%">
<Button onClick={handleClickAddTab} isChecked={addModelTab === 'add'} size="sm" width="100%">
{t('modelManager.addModel')}
</Button>
<Button onClick={handleClickScanTab} isChecked={addModelTab == 'scan'} size="sm" width="100%" isDisabled>
<Button onClick={handleClickScanTab} isChecked={addModelTab === 'scan'} size="sm" width="100%" isDisabled>
{t('modelManager.scanForModels')}
</Button>
</ButtonGroup>
{addModelTab == 'add' && <AddModels />}
{addModelTab == 'scan' && <ScanModels />}
{addModelTab === 'add' && <AddModels />}
{addModelTab === 'scan' && <ScanModels />}
</Flex>
);
};

View File

@ -58,11 +58,11 @@ const AddNodePopover = () => {
// If we have a connection in progress, we need to filter the node choices
const filteredNodeTemplates = fieldFilter
? filter(nodeTemplates.templates, (template) => {
const handles = handleFilter == 'source' ? template.inputs : template.outputs;
const handles = handleFilter === 'source' ? template.inputs : template.outputs;
return some(handles, (handle) => {
const sourceType = handleFilter == 'source' ? fieldFilter : handle.type;
const targetType = handleFilter == 'target' ? fieldFilter : handle.type;
const sourceType = handleFilter === 'source' ? fieldFilter : handle.type;
const targetType = handleFilter === 'target' ? fieldFilter : handle.type;
return validateSourceAndTargetTypes(sourceType, targetType);
});

View File

@ -50,16 +50,16 @@ export const findConnectionToValidHandle = (
return null;
}
const handles = handleCurrentType == 'source' ? node.data.inputs : node.data.outputs;
const handles = handleCurrentType === 'source' ? node.data.inputs : node.data.outputs;
//Prioritize handles whos name matches the node we're coming from
if (handles[handleCurrentName]) {
const handle = handles[handleCurrentName];
const sourceID = handleCurrentType == 'source' ? handleCurrentNodeId : node.id;
const targetID = handleCurrentType == 'source' ? node.id : handleCurrentNodeId;
const sourceHandle = handleCurrentType == 'source' ? handleCurrentName : handle.name;
const targetHandle = handleCurrentType == 'source' ? handle.name : handleCurrentName;
const sourceID = handleCurrentType === 'source' ? handleCurrentNodeId : node.id;
const targetID = handleCurrentType === 'source' ? node.id : handleCurrentNodeId;
const sourceHandle = handleCurrentType === 'source' ? handleCurrentName : handle.name;
const targetHandle = handleCurrentType === 'source' ? handle.name : handleCurrentName;
const isGraphAcyclic = getIsGraphAcyclic(sourceID, targetID, nodes, edges);
@ -78,10 +78,10 @@ export const findConnectionToValidHandle = (
for (const handleName in handles) {
const handle = handles[handleName];
const sourceID = handleCurrentType == 'source' ? handleCurrentNodeId : node.id;
const targetID = handleCurrentType == 'source' ? node.id : handleCurrentNodeId;
const sourceHandle = handleCurrentType == 'source' ? handleCurrentName : handle.name;
const targetHandle = handleCurrentType == 'source' ? handle.name : handleCurrentName;
const sourceID = handleCurrentType === 'source' ? handleCurrentNodeId : node.id;
const targetID = handleCurrentType === 'source' ? node.id : handleCurrentNodeId;
const sourceHandle = handleCurrentType === 'source' ? handleCurrentName : handle.name;
const targetHandle = handleCurrentType === 'source' ? handle.name : handleCurrentName;
const isGraphAcyclic = getIsGraphAcyclic(sourceID, targetID, nodes, edges);

View File

@ -175,7 +175,7 @@ export const addHrfToGraph = (state: RootState, graph: NonNullableGraph): void =
width: width,
height: height,
};
if (hrfMethod == 'ESRGAN') {
if (hrfMethod === 'ESRGAN') {
let model_name: ESRGANInvocation['model_name'] = 'RealESRGAN_x2plus.pth';
if ((width * height) / (hrfWidth * hrfHeight) > 2) {
model_name = 'RealESRGAN_x4plus.pth';

View File

@ -96,7 +96,7 @@ export const addSeamlessToLinearGraph = (
);
if (
graph.id == CANVAS_INPAINT_GRAPH ||
graph.id === CANVAS_INPAINT_GRAPH ||
graph.id === CANVAS_OUTPAINT_GRAPH ||
graph.id === SDXL_CANVAS_INPAINT_GRAPH ||
graph.id === SDXL_CANVAS_OUTPAINT_GRAPH

View File

@ -70,7 +70,7 @@ export const addVAEToGraph = (
graph.id === CANVAS_TEXT_TO_IMAGE_GRAPH ||
graph.id === CANVAS_IMAGE_TO_IMAGE_GRAPH ||
graph.id === SDXL_CANVAS_TEXT_TO_IMAGE_GRAPH ||
graph.id == SDXL_CANVAS_IMAGE_TO_IMAGE_GRAPH
graph.id === SDXL_CANVAS_IMAGE_TO_IMAGE_GRAPH
) {
graph.edges.push({
source: {