Page MenuHomePhabricator

D6396.diff
No OneTemporary

D6396.diff

diff --git a/lib/components/ens-cache-provider.react.js b/lib/components/ens-cache-provider.react.js
--- a/lib/components/ens-cache-provider.react.js
+++ b/lib/components/ens-cache-provider.react.js
@@ -14,14 +14,14 @@
);
type Props = {
- +provider: EthersProvider,
+ +provider: ?EthersProvider,
+children: React.Node,
};
function ENSCacheProvider(props: Props): React.Node {
const { provider, children } = props;
const context = React.useMemo(
() => ({
- ensCache: new ENSCache(provider),
+ ensCache: provider ? new ENSCache(provider) : null,
}),
[provider],
);
diff --git a/native/utils/ethers-utils.js b/native/utils/ethers-utils.js
--- a/native/utils/ethers-utils.js
+++ b/native/utils/ethers-utils.js
@@ -13,9 +13,9 @@
alchemyKey = key;
} catch {}
-const provider: EthersProvider = new ethers.providers.AlchemyProvider(
- 'mainnet',
- alchemyKey,
-);
+let provider: ?EthersProvider;
+if (alchemyKey) {
+ provider = new ethers.providers.AlchemyProvider('mainnet', alchemyKey);
+}
export { provider };

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 11:05 AM (18 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2677011
Default Alt Text
D6396.diff (1 KB)

Event Timeline