From 1a15a7f9a91525e94df355896e01929db74311c9 Mon Sep 17 00:00:00 2001 From: Sherkhan Azimov Date: Mon, 13 May 2024 22:40:45 +0200 Subject: [PATCH 1/2] fix: remove dead accounts from leaderboard --- packages/react-app/src/LeaderboardCollectors.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/react-app/src/LeaderboardCollectors.js b/packages/react-app/src/LeaderboardCollectors.js index 86a5adc..94ca9fb 100644 --- a/packages/react-app/src/LeaderboardCollectors.js +++ b/packages/react-app/src/LeaderboardCollectors.js @@ -195,12 +195,18 @@ export default function Leaderboard(props) {
    - {artists.length > 0 - ? artists.map((artist, i) => { + {artists.length > 0 + ? artists + .filter( + (artist) => + artist.address !== + "0x000000000000000000000000000000000000dead" && + artist.address !== + "0xdead000000000000000042069420694206942069" + ) + .map((artist, i) => { if ( - artist[orderBy] > 0 && - artist.address !== - "0x000000000000000000000000000000000000dead" + artist[orderBy] > 0 ) { return (
  • Date: Mon, 13 May 2024 23:23:30 +0200 Subject: [PATCH 2/2] fix: return previous code for addressinput --- .../react-app/src/components/AddressInput.js | 41 +++++++++++++++---- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/packages/react-app/src/components/AddressInput.js b/packages/react-app/src/components/AddressInput.js index 783a58f..5df2b0d 100644 --- a/packages/react-app/src/components/AddressInput.js +++ b/packages/react-app/src/components/AddressInput.js @@ -6,11 +6,41 @@ import { Input, Badge } from 'antd'; export default function AddressInput(props) { + const [ ens, setEns ] = useState(0) const [ value, setValue ] = useState() - const [isAddressFound, setIsAddressFound] = useState(false); const currentValue = typeof props.value != "undefined"?props.value:value + useEffect(()=>{ + setEns("") + if(currentValue && props.ensProvider){ + async function getEns(){ + let newEns + try{ + console.log("trying reverse ens",newEns) + + newEns = await props.ensProvider.lookupAddress(currentValue) + console.log("setting ens",newEns) + setEns(newEns) + }catch(e){} + console.log("checking resolve") + if( currentValue.indexOf(".eth")>0 || currentValue.indexOf(".xyz")>0 ){ + try{ + console.log("resolving") + let possibleAddress = await props.ensProvider.resolveName(currentValue); + console.log("GOT:L",possibleAddress) + if(possibleAddress){ + setEns(currentValue) + props.onChange(possibleAddress) + } + }catch(e){} + } + } + getEns() + } + },[props.value]) + + const [ scan, setScan ] = useState(false) let scannerButton = ( @@ -32,11 +62,8 @@ export default function AddressInput(props) { let possibleAddress = await props.ensProvider.resolveName(address); if(possibleAddress){ address = possibleAddress - setIsAddressFound(true); } }catch(e){} - } else { - setIsAddressFound(true); } setValue(address) if(typeof props.onChange == "function") { props.onChange(address) } @@ -78,10 +105,10 @@ export default function AddressInput(props) {
    {scanner} } - value={currentValue} + value={ens?ens:currentValue} addonAfter={scannerButton} onChange={(e)=>{ updateAddress(e.target.value) @@ -89,4 +116,4 @@ export default function AddressInput(props) { />
    ); -} +} \ No newline at end of file