Skip to content

Commit a58e27d

Browse files
authored
[FIX] don't disable angle on non-unique name, if create var checkbox is unchecked (#7930)
* don't disable angle on non-unique name, if create var checkbox is uncheck * empty commit * empty commit
1 parent 7c30a79 commit a58e27d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/SetAngleLengthModal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ export const SetAngleLengthModal = ({
6464
initialVariableName: valueName,
6565
selectionRanges,
6666
})
67+
const isDisabled =
68+
(calcResult === 'NAN' || !isNewVariableNameUnique) && shouldCreateVariable
6769

6870
return (
6971
<Transition appear show={isOpen} as={Fragment}>
@@ -141,11 +143,9 @@ export const SetAngleLengthModal = ({
141143
<div className="mt-4">
142144
<button
143145
type="button"
144-
disabled={calcResult === 'NAN' || !isNewVariableNameUnique}
146+
disabled={isDisabled}
145147
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' : ''
149149
}`}
150150
onClick={() =>
151151
valueNode &&

0 commit comments

Comments
 (0)