From 0ade87c9711c721d3e141146bc9b8585e752f617 Mon Sep 17 00:00:00 2001 From: EnzoVezzaro Date: Mon, 4 Apr 2022 09:16:22 -0400 Subject: [PATCH] fix "owned by" label on preview (#1303) * fix "owner by" label on preview * cleanup - remove unused code * restore 3box --- src/components/@shared/Publisher/index.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/@shared/Publisher/index.tsx b/src/components/@shared/Publisher/index.tsx index abc4f39ab..0eecd5fa0 100644 --- a/src/components/@shared/Publisher/index.tsx +++ b/src/components/@shared/Publisher/index.tsx @@ -5,8 +5,6 @@ import Link from 'next/link' import get3BoxProfile from '@utils/profile' import { accountTruncate } from '@utils/web3' import axios from 'axios' -import Add from './Add' -import { useWeb3 } from '@context/Web3' import { getEnsName } from '@utils/ens' import { useIsMounted } from '@hooks/useIsMounted' @@ -21,17 +19,18 @@ export default function Publisher({ minimal?: boolean className?: string }): ReactElement { - // const { accountId } = useWeb3() const isMounted = useIsMounted() const [profile, setProfile] = useState() - const [name, setName] = useState(accountTruncate(account)) + const [name, setName] = useState('') const [accountEns, setAccountEns] = useState() - // const showAdd = account === accountId && !profile - useEffect(() => { if (!account) return + // set default name on hook + // to avoid side effect (UI not updating on account's change) + setName(accountTruncate(account)) + const source = axios.CancelToken.source() async function getExternalName() { @@ -70,7 +69,6 @@ export default function Publisher({ {name} - {/* {showAdd && } */} )}