chore(types): used KeyboardCode enum
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 31s
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 31s
This commit is contained in:
parent
e37f90d6db
commit
3a94fbc0ae
@ -21,7 +21,8 @@ import {
|
||||
ProfileMetadata,
|
||||
SignedEvent,
|
||||
User,
|
||||
UserRole
|
||||
UserRole,
|
||||
KeyboardCode
|
||||
} from '../../types'
|
||||
import {
|
||||
encryptArrayBuffer,
|
||||
@ -87,7 +88,10 @@ export const CreatePage = () => {
|
||||
|
||||
const [userInput, setUserInput] = useState('')
|
||||
const handleInputKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {
|
||||
if (event.code === 'Enter' || event.code === 'NumpadEnter') {
|
||||
if (
|
||||
event.code === KeyboardCode.Enter ||
|
||||
event.code === KeyboardCode.NumpadEnter
|
||||
) {
|
||||
event.preventDefault()
|
||||
handleAddUser()
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import { toast } from 'react-toastify'
|
||||
import { LoadingSpinner } from '../../components/LoadingSpinner'
|
||||
import { AuthController } from '../../controllers'
|
||||
import { updateKeyPair, updateLoginMethod } from '../../store/actions'
|
||||
import { KeyboardCode } from '../../types'
|
||||
import { LoginMethod } from '../../store/auth/types'
|
||||
import { hexToBytes } from '@noble/hashes/utils'
|
||||
|
||||
@ -52,7 +53,10 @@ export const Nostr = () => {
|
||||
* Call login function when enter is pressed
|
||||
*/
|
||||
const handleInputKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {
|
||||
if (event.code === 'Enter' || event.code === 'NumpadEnter') {
|
||||
if (
|
||||
event.code === KeyboardCode.Enter ||
|
||||
event.code === KeyboardCode.NumpadEnter
|
||||
) {
|
||||
event.preventDefault()
|
||||
login()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user