Skip to content

Commit

Permalink
fix login input area
Browse files Browse the repository at this point in the history
  • Loading branch information
TheodoreKrypton committed Jan 1, 2021
1 parent 3bf247e commit d039c2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@
"eslint-plugin-react": "^7.20.5",
"eslint-plugin-react-hooks": "^4.0.8"
}
}
}
6 changes: 3 additions & 3 deletions src/pages/Login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ export default () => {
const [input, setInput] = React.useState('');
const [open, setOpen] = React.useState(!api.hasUserpass());

const handleProceed = () => {
const handleProceed = React.useCallback(() => {
api.authByPassword({ password: input }).then((rsp) => {
if (rsp) {
setOpen(false);
window.location.reload();
}
});
};
}, [input]);

return (
<>
Expand All @@ -36,7 +36,7 @@ export default () => {
type="password"
color="secondary"
value={input}
onChange={setInput}
onChange={(ev) => { setInput(ev.target.value); }}
fullWidth
/>
</DialogContent>
Expand Down

0 comments on commit d039c2f

Please sign in to comment.