Skip to content

Commit

Permalink
remove fillet button in production build
Browse files Browse the repository at this point in the history
  • Loading branch information
Irev-Dev committed Jul 15, 2024
1 parent daf2b80 commit 59b2f68
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
canRectangleTool,
isEditingExistingSketch,
} from 'machines/modelingMachine'
import { DEV } from 'env'

export function Toolbar({
className = '',
Expand Down Expand Up @@ -118,14 +119,15 @@ export function Toolbar({
}),
{ enabled: !disableAllButtons, scopes: ['modeling'] }
)
const disableFillet = !state.can('Fillet') || disableAllButtons
useHotkeys(
'f',
() =>
commandBarSend({
type: 'Find and select command',
data: { name: 'Fillet', groupId: 'modeling' },
}),
{ enabled: !disableAllButtons, scopes: ['modeling'] }
{ enabled: !disableFillet, scopes: ['modeling'] }
)

function handleToolbarButtonsWheelEvent(ev: WheelEvent<HTMLSpanElement>) {
Expand Down Expand Up @@ -413,7 +415,7 @@ export function Toolbar({
</ActionButton>
</li>
)}
{state.matches('idle') && (
{state.matches('idle') && DEV && (
<li className="contents">
<ActionButton
className={buttonClassName}
Expand All @@ -424,10 +426,8 @@ export function Toolbar({
data: { name: 'Fillet', groupId: 'modeling' },
})
}
disabled={!state.can('Fillet') || disableAllButtons}
title={
state.can('Fillet') ? 'fillet' : 'sketches need to be closed'
}
disabled={disableFillet}
title={disableFillet ? 'fillet' : "edge can't be filleted"}
iconStart={{
icon: 'fillet', // todo: add fillet icon
iconClassName,
Expand Down
1 change: 0 additions & 1 deletion src/lang/std/sketch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ function getTag(index = 2): SketchLineHelper['getTag'] {
return new Error('Not a CallExpression')
const arg = callExp.arguments?.[index]
if (!arg) return new Error('No argument')
console.log('arg', arg)
if (arg.type !== 'TagDeclarator')
return new Error('Tag not a TagDeclarator')
return arg.value
Expand Down

0 comments on commit 59b2f68

Please sign in to comment.