-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix wagmi SSR and projectId not found (#4931)
* Fix wagmi SSR and projectId not found * Fallback to process.env * Get env var from server
- Loading branch information
1 parent
2ab27a0
commit c563372
Showing
4 changed files
with
31 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 8 additions & 6 deletions
14
apps/scoutgame/components/common/WalletLogin/WalletProvider.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import { headers } from 'next/headers'; | ||
import { cookieToInitialState } from 'wagmi'; | ||
|
||
import { getConfig } from 'components/common/WalletLogin/wagmiConfig'; | ||
|
||
import { WagmiProvider } from './WagmiProvider'; | ||
|
||
export function WalletProvider({ children }: { children: React.ReactNode }) { | ||
const wagmiInitialState = cookieToInitialState(getConfig(), headers().get('cookie')); | ||
|
||
return <WagmiProvider initialState={wagmiInitialState}>{children}</WagmiProvider>; | ||
return ( | ||
<WagmiProvider | ||
cookie={headers().get('cookie') ?? ''} | ||
walletConnectProjectId={process.env.REACT_APP_WALLETCONNECT_PROJECTID} | ||
> | ||
{children} | ||
</WagmiProvider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters