Don't equip Line tool if sketch has a circle

This commit is contained in:
Frank Noirot
2024-08-05 15:01:12 +02:00
parent fa973e7b89
commit b95272cf03

View File

@ -1705,7 +1705,10 @@ export function isEditingExistingSketch({
(item) =>
item.type === 'CallExpression' && item.callee.name === 'startProfileAt'
)
return hasStartProfileAt && pipeExpression.body.length > 2
const hasCircle = pipeExpression.body.some(
(item) => item.type === 'CallExpression' && item.callee.name === 'circle'
)
return (hasStartProfileAt && pipeExpression.body.length > 2) || hasCircle
}
export function canRectangleTool({