Skip to content

Commit

Permalink
changed disabled logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Cancuuu committed Nov 3, 2022
1 parent fbfd8cc commit a76e72d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/views/Extension/Views/ImportPrivateKey/Steps/Step1.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Step1 = ({ handleChangeStep, setPrivateKey, privateKey }) => {
const classes = useStyles();

const [loading, setLoading] = useState(false);
const [disabled, setDisabled] = useState(false);
const [disabled, setDisabled] = useState(true);
const [invalidPem, setInvalidPem] = useState(null);

const handlePrivateKey = (e) => {
Expand All @@ -25,13 +25,13 @@ const Step1 = ({ handleChangeStep, setPrivateKey, privateKey }) => {
},
(a) => {
if (a) {
setDisabled(true);
setDisabled(false);
setInvalidPem(false);
setLoading(false);
} else {
setInvalidPem(true);
setLoading(false);
setDisabled(false);
setDisabled(true);
}
},
);
Expand Down Expand Up @@ -63,7 +63,7 @@ const Step1 = ({ handleChangeStep, setPrivateKey, privateKey }) => {
value={t("common.continue")}
onClick={() => handleChangeStep(1)}
loading={loading}
disabled={!disabled}
disabled={disabled}
fullWidth
data-testid="add-button"
/>
Expand Down

0 comments on commit a76e72d

Please sign in to comment.