From 633da60d17958c38fc1cef44b5184f6af8c66310 Mon Sep 17 00:00:00 2001 From: chef-ryan <ryan@pancakeswap.com> Date: Tue, 7 Jan 2025 14:39:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Fix=20submit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/src/views/Voting/CreateProposal/index.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/web/src/views/Voting/CreateProposal/index.tsx b/apps/web/src/views/Voting/CreateProposal/index.tsx index c4fde6dc8d7ee..5e954460e669f 100644 --- a/apps/web/src/views/Voting/CreateProposal/index.tsx +++ b/apps/web/src/views/Voting/CreateProposal/index.tsx @@ -1,4 +1,4 @@ -import { Suspense, useEffect } from 'react' +import { Suspense, useEffect, useMemo } from 'react' import { Controller, useFieldArray, useForm } from 'react-hook-form' import { useTranslation } from '@pancakeswap/localization' @@ -66,7 +66,7 @@ const CreateProposal = () => { const { data: signer } = useWalletClient() const initialBlock = useInitialBlock() const { delay, period } = space?.voting || {} - const created = Math.floor(Date.now() / 1000) // current timestamp in seconds + const created = useMemo(() => Math.floor(Date.now() / 1000), []) // current timestamp in seconds const { push } = useRouter() const { @@ -214,7 +214,7 @@ const CreateProposal = () => { <Input id="name" // register returns an object of onChange, onBlur, ref, etc. - // Provide validations inline or via a validation resolver. + // Provide valiions inline or via a validation resolver. // e.g. required: t('Title is required') {...register('name', { required: t('Title is required') as string })} scale="lg" @@ -360,7 +360,6 @@ const CreateProposal = () => { <Text color="textSubtle" mr="16px"> {t('Voting Power')} </Text> - <Text>{isLoading ? '-' : total ?? 0}</Text> <Box ml="8px"> <TooltipText ref={votingPowerTargetRef}>{isLoading ? '-' : total ?? 0}</TooltipText> {votingPowerTooltipVisible && votingPowerTooltip}