Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3354280
D8349.id28202.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D8349.id28202.diff
View Options
diff --git a/landing/siwe.react.js b/landing/siwe.react.js
--- a/landing/siwe.react.js
+++ b/landing/siwe.react.js
@@ -37,19 +37,22 @@
import css from './siwe.css';
import { useMonitorForWalletConnectModal } from './walletconnect-hooks.js';
-const projectId = process.env.COMM_WALLETCONNECT_KEY;
const { chains, provider } = configureWagmiChains(process.env.COMM_ALCHEMY_KEY);
+
+const wallets = [injectedWallet({ chains })];
+const projectId = process.env.COMM_WALLETCONNECT_KEY;
+if (projectId) {
+ wallets.push(
+ rainbowWallet({ chains, projectId }),
+ metaMaskWallet({ chains, projectId }),
+ walletConnectWallet({ chains, projectId }),
+ );
+}
+
const connectors = connectorsForWallets([
- {
- groupName: 'Recommended',
- wallets: [
- injectedWallet({ chains }),
- rainbowWallet({ chains, projectId }),
- metaMaskWallet({ chains, projectId }),
- walletConnectWallet({ chains, projectId }),
- ],
- },
+ { groupName: 'Recommended', wallets },
]);
+
const wagmiClient = createWagmiClient({ connectors, provider });
function postMessageToNativeWebView(message: SIWEWebViewMessage) {
diff --git a/lib/utils/wagmi-utils.js b/lib/utils/wagmi-utils.js
--- a/lib/utils/wagmi-utils.js
+++ b/lib/utils/wagmi-utils.js
@@ -46,19 +46,22 @@
});
}
-const projectId = process.env.COMM_WALLETCONNECT_KEY;
const { chains, provider } = configureWagmiChains(process.env.COMM_ALCHEMY_KEY);
+
+const wallets = [injectedWallet({ chains })];
+const projectId = process.env.COMM_WALLETCONNECT_KEY;
+if (projectId) {
+ wallets.push(
+ rainbowWallet({ chains, projectId }),
+ metaMaskWallet({ chains, projectId }),
+ walletConnectWallet({ chains, projectId }),
+ );
+}
+
const connectors = connectorsForWallets([
- {
- groupName: 'Recommended',
- wallets: [
- injectedWallet({ chains }),
- rainbowWallet({ chains, projectId }),
- metaMaskWallet({ chains, projectId }),
- walletConnectWallet({ chains, projectId }),
- ],
- },
+ { groupName: 'Recommended', wallets },
]);
+
const wagmiClient: mixed = createWagmiClient({ connectors, provider });
const wagmiChains: mixed = chains;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 12:42 PM (20 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2574421
Default Alt Text
D8349.id28202.diff (2 KB)
Attached To
Mode
D8349: [web][lib][landing] Prevent crash when missing WalletConnect key
Attached
Detach File
Event Timeline
Log In to Comment