File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,8 @@ export const SetAngleLengthModal = ({
64
64
initialVariableName : valueName ,
65
65
selectionRanges,
66
66
} )
67
+ const isDisabled =
68
+ ( calcResult === 'NAN' || ! isNewVariableNameUnique ) && shouldCreateVariable
67
69
68
70
return (
69
71
< Transition appear show = { isOpen } as = { Fragment } >
@@ -141,11 +143,9 @@ export const SetAngleLengthModal = ({
141
143
< div className = "mt-4" >
142
144
< button
143
145
type = "button"
144
- disabled = { calcResult === 'NAN' || ! isNewVariableNameUnique }
146
+ disabled = { isDisabled }
145
147
className = { `inline-flex justify-center rounded-md border border-transparent bg-blue-100 px-4 py-2 text-sm font-medium text-blue-900 hover:bg-blue-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 ${
146
- calcResult === 'NAN' || ! isNewVariableNameUnique
147
- ? 'opacity-50 cursor-not-allowed'
148
- : ''
148
+ isDisabled ? 'opacity-50 cursor-not-allowed' : ''
149
149
} `}
150
150
onClick = { ( ) =>
151
151
valueNode &&
You can’t perform that action at this time.
0 commit comments