Skip to content

Commit

Permalink
Added bounce
Browse files Browse the repository at this point in the history
  • Loading branch information
githubsaturn committed Aug 6, 2023
1 parent 92ded0a commit 36b569a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/containers/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ const radioStyle = {
lineHeight: '30px',
}

let lastSubmittedTime = 0

class NormalLoginForm extends React.Component<
any,
{
Expand All @@ -120,6 +122,9 @@ class NormalLoginForm extends React.Component<

handleSubmit = (e?: React.FormEvent): void => {
e?.preventDefault()
const now = new Date().getTime()
if (now - lastSubmittedTime < 300) return // avoid duplicate clicks
lastSubmittedTime = now
const self = this
self.props.onLoginRequested(
self.state.passwordEntered,
Expand Down

0 comments on commit 36b569a

Please sign in to comment.