Skip to content

Commit 8eb8a05

Browse files
authored
fix deposit screen when using wallet connect (#501)
* fix deposit screen when using wallet connect * no mas desposito
1 parent 761f36f commit 8eb8a05

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

apps/next/pages/deposit/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const Page: NextPageWithLayout = () => {
99
return (
1010
<>
1111
<Head>
12-
<title>Send | Desposit</title>
12+
<title>Send | Deposit</title>
1313
</Head>
1414
<DepositScreen />
1515
</>
@@ -19,7 +19,7 @@ export const Page: NextPageWithLayout = () => {
1919
export const getServerSideProps = userProtectedGetSSP()
2020

2121
Page.getLayout = (children) => (
22-
<HomeLayout TopNav={<TopNav header="Desposit" />}>{children}</HomeLayout>
22+
<HomeLayout TopNav={<TopNav header="Deposit" />}>{children}</HomeLayout>
2323
)
2424

2525
export default Page

packages/app/features/deposit/screen.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ export function DepositWelcome(props: YStackProps) {
3636

3737
<Fade>
3838
<Stack gap={'$4'} w={'100%'} $gtMd={{ flexDirection: 'row' }}>
39-
<DespositWeb3Link />
40-
<DespositCoinbasePay />
39+
<DepositWeb3Link />
40+
<DepositCoinbasePay />
4141
</Stack>
4242
</Fade>
4343
</YStack>
4444
</YStack>
4545
)
4646
}
4747

48-
function DespositWeb3Link() {
48+
function DepositWeb3Link() {
4949
return (
5050
<DepositStackButton>
5151
<DepositButton
@@ -60,7 +60,7 @@ function DespositWeb3Link() {
6060
)
6161
}
6262

63-
function DespositCoinbasePay() {
63+
function DepositCoinbasePay() {
6464
const toast = useToastController()
6565
return (
6666
<DepositStackButton disabled disabledStyle={{ opacity: 0.5 }}>

packages/app/features/deposit/web3/screen.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,12 @@ function FailsafeChainId({ children }: { children: React.ReactNode }) {
393393
const [error, setError] = useState<string>()
394394
const [ignoreError, setIgnoreError] = useState(false)
395395
const { open: openWeb3Modal } = useWeb3Modal()
396+
// @ts-expect-error wagmi connector ensures this is there
397+
const canCheckChainId = isWeb && window.ethereum
396398

397399
// biome-ignore lint/correctness/useExhaustiveDependencies: hack
398400
useEffect(() => {
399-
if (isWeb) {
401+
if (canCheckChainId) {
400402
// @ts-expect-error wagmi connector ensures this is there
401403
window.ethereum
402404
.request({ method: 'eth_chainId' })
@@ -405,7 +407,7 @@ function FailsafeChainId({ children }: { children: React.ReactNode }) {
405407
}
406408
}, [chainId, openWeb3Modal])
407409

408-
if (!isWeb) return children // we don't need to do anything on non-web
410+
if (!canCheckChainId) return children // we don't need to do anything on non-web or wallet connect somtimes does not add ethereum provider
409411

410412
if (failsafeChainId === undefined) {
411413
return (

0 commit comments

Comments
 (0)