Skip to content

Commit

Permalink
pluck off googleClientId from google-waas connector params
Browse files Browse the repository at this point in the history
  • Loading branch information
corbanbrook committed Apr 26, 2024
1 parent 3ad33ba commit 4908ad1
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions packages/kit/src/components/KitProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { sequence } from '0xsequence'
import { GoogleOAuthProvider } from '@react-oauth/google'
import { Box, Button, Card, Collapsible, Modal, Text, ThemeProvider } from '@0xsequence/design-system'
import { AnimatePresence } from 'framer-motion'
import { Connector, useAccount, useConnections } from 'wagmi'
import { Connector, useAccount, useConfig, useConnections } from 'wagmi'
import { ethers } from 'ethers'

import '@0xsequence/design-system/styles.css'
Expand All @@ -19,7 +19,7 @@ import {
WalletConfigContextProvider,
AnalyticsContextProvider
} from '../../contexts'
import { ModalPosition, getModalPositionCss } from '../../utils'
import { ExtendedConnector, ModalPosition, getModalPositionCss } from '../../utils'

import * as sharedStyles from '../styles.css'

Expand Down Expand Up @@ -103,14 +103,13 @@ export const KitProvider = (props: KitConnectProviderProps) => {

// const googleClientId = localStorage.getItem(LocalStorageKey.WaasGoogleClientID) || ''

const [googleClientId, setGoogleClientId] = useState<string>('')
const wagmiConfig = useConfig()
const googleWaasConnector = wagmiConfig.connectors.find(
c => c.id === 'sequence-waas' && (c as ExtendedConnector)._wallet.id === 'google-waas'
) as ExtendedConnector | undefined
const googleClientId: string = (googleWaasConnector as any)?.params?.googleClientId || ''

useEffect(() => {
// TODO: this is silly, do not use localStorage, instead get them from the runtime
// config object.
const googleClientId = localStorage.getItem(LocalStorageKey.WaasGoogleClientID) || ''
setGoogleClientId(googleClientId)
}, [])
console.log('googleClientId', googleClientId)

const setupAnalytics = (projectAccessKey: string) => {
const s = sequence.initWallet(projectAccessKey)
Expand Down

0 comments on commit 4908ad1

Please sign in to comment.