From 5533e7786eca173b7eb00fd5b7ec371f295b9843 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Fri, 22 Oct 2021 16:52:28 -0300 Subject: [PATCH] Fix typechecking after ethers 5.5.1 fix/improvement --- src/useReverseCache.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/useReverseCache.ts b/src/useReverseCache.ts index 86c6472..365888a 100644 --- a/src/useReverseCache.ts +++ b/src/useReverseCache.ts @@ -25,7 +25,7 @@ export const useENSCache = ( const addresses = Array.from(addrSet); const reverseResolve = async () => { - const solvers: Promise[] = []; + const solvers: Promise[] = []; for (const a of addresses) { solvers.push(provider.lookupAddress(a)); } @@ -33,10 +33,11 @@ export const useENSCache = ( const results = await Promise.all(solvers); const cache: ENSReverseCache = {}; for (let i = 0; i < results.length; i++) { - if (results[i] === null) { + const r = results[i]; + if (r === null) { continue; } - cache[addresses[i]] = results[i]; + cache[addresses[i]] = r; } setReverseCache(cache); };