From 382f58898f22877210b96285805d3fb0c5d21ba0 Mon Sep 17 00:00:00 2001 From: RadoslavDimchev Date: Thu, 19 Oct 2023 06:36:21 +0300 Subject: [PATCH] feat: add effect to generate id at initial --- src/pages/PairDevice/GenerateId.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/PairDevice/GenerateId.tsx b/src/pages/PairDevice/GenerateId.tsx index 55bc4f5b..72b3a92d 100644 --- a/src/pages/PairDevice/GenerateId.tsx +++ b/src/pages/PairDevice/GenerateId.tsx @@ -1,7 +1,7 @@ import { Button, Input, Text as StatusText } from '@status-im/components' import { CompleteIdIcon, CopyIcon } from '@status-im/icons' import { Text } from '@tamagui/web' -import { useState } from 'react' +import { useEffect, useState } from 'react' import { Link } from 'react-router-dom' import { Separator, XStack, YStack } from 'tamagui' import { v4 as uuidv4 } from 'uuid' @@ -13,6 +13,10 @@ type GenerateIdProps = { const GenerateId = ({ isAwaitingPairing }: GenerateIdProps) => { const [generatedId, setGeneratedId] = useState('') + useEffect(() => { + generateIdHandler() + }, []) + const generateIdHandler = () => { setGeneratedId(uuidv4()) }