Merge pull request #25 from nimbus-gui/rd.autogenerate-id-into-pair-device

Autogenerate ID into pair device
This commit is contained in:
Hristo Nedelkov 2023-10-20 19:44:36 +03:00 committed by GitHub
commit b1990a794d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -1,7 +1,7 @@
import { Button, Input, Text as StatusText } from '@status-im/components' import { Button, Input, Text as StatusText } from '@status-im/components'
import { CompleteIdIcon, CopyIcon } from '@status-im/icons' import { CompleteIdIcon, CopyIcon } from '@status-im/icons'
import { Text } from '@tamagui/web' import { Text } from '@tamagui/web'
import { useState } from 'react' import { useEffect, useState } from 'react'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import { Separator, XStack, YStack } from 'tamagui' import { Separator, XStack, YStack } from 'tamagui'
import { v4 as uuidv4 } from 'uuid' import { v4 as uuidv4 } from 'uuid'
@ -13,6 +13,10 @@ type GenerateIdProps = {
const GenerateId = ({ isAwaitingPairing }: GenerateIdProps) => { const GenerateId = ({ isAwaitingPairing }: GenerateIdProps) => {
const [generatedId, setGeneratedId] = useState('') const [generatedId, setGeneratedId] = useState('')
useEffect(() => {
generateIdHandler()
}, [])
const generateIdHandler = () => { const generateIdHandler = () => {
setGeneratedId(uuidv4()) setGeneratedId(uuidv4())
} }