Skip to content

Commit

Permalink
feat: reset onboarding if not signed in
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-stumpf committed Jul 30, 2024
1 parent 9252032 commit 45e7896
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"use client"

import { walletSelectorModalAtom } from "@/components/Providers/atoms"
import { useWeb3ConnectionManager } from "@/components/Web3ConnectionManager/hooks/useWeb3ConnectionManager"
import { Button } from "@/components/ui/Button"
import { cardClassName } from "@/components/ui/Card"
import { cn } from "@/lib/utils"
import { useState } from "react"
import { useSetAtom } from "jotai"
import { useEffect, useState } from "react"
import { SUBSCRIPTIONS } from "../constants"
import { ChainData, DispatchChainAction, OnboardingChain } from "../types"
import { ChoosePass } from "./ChoosePass"
Expand All @@ -20,6 +23,16 @@ const chains: OnboardingChain[] = [

export const OnboardingDriver = () => {
const [chainIndex, setChainIndex] = useState(3)
const { address } = useWeb3ConnectionManager()
const setIsWalletSelectorModalOpen = useSetAtom(walletSelectorModalAtom)

useEffect(() => {
if (!address) {
setChainIndex(0)
setIsWalletSelectorModalOpen(true)
}
}, [address, setIsWalletSelectorModalOpen])

// TODO: remove default chosen subscription, as it is only there for debug
// purposes
const [chainData, setChainData] = useState<Partial<ChainData>>({
Expand Down

0 comments on commit 45e7896

Please sign in to comment.