From e6c038df9e168c09ad7aa2c63a855fc418c07108 Mon Sep 17 00:00:00 2001 From: Patryk Kalinowski Date: Tue, 16 Jul 2024 12:07:11 +0200 Subject: [PATCH] Fix TSC errors --- src/App.tsx | 2 +- src/Login.tsx | 9 +++------ src/components/views/EmailConflictWarningView.tsx | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 96cf3e6..45d0f89 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -40,7 +40,7 @@ function App() { setFetchWalletAddressError(e.message) }) - sequence.listAccounts().then((response: any) => { + sequence.listAccounts().then((response) => { if (response.currentAccountId) { setCurrentAccount(response.accounts.find(account => account.id === response.currentAccountId)) } diff --git a/src/Login.tsx b/src/Login.tsx index b7a8eb7..dbb1ecb 100644 --- a/src/Login.tsx +++ b/src/Login.tsx @@ -1,4 +1,4 @@ -import { Box, Text, TextInput, Button, Spinner, useTheme, Checkbox, Divider, Modal } from '@0xsequence/design-system' +import { Box, Text, TextInput, Button, Spinner, Checkbox, Divider, Modal } from '@0xsequence/design-system' import { SetStateAction, useEffect, useRef, useState } from 'react' import { CredentialResponse, GoogleLogin, useGoogleLogin } from '@react-oauth/google' import AppleSignin from 'react-apple-signin-auth' @@ -15,9 +15,6 @@ import { useSessionHash } from './utils/useSessionHash.ts' import { useEmailAuthV2 } from './utils/useEmailAuthV2.ts' import {StytchLogin} from "./components/StytchLogin.tsx"; -const urlParams = new URLSearchParams(window.location.search) -const targetEnv = urlParams.get('env') ?? 'prod' - function Login() { const { sessionHash } = useSessionHash() const [email, setEmail] = useState('') @@ -39,13 +36,13 @@ function Login() { const handleGooglePlayfabLogin = useGoogleLogin({ flow: 'implicit', onSuccess: tokenResponse => { - ;(window as any).PlayFabClientSDK.LoginWithGoogleAccount( + (window as any).PlayFabClientSDK.LoginWithGoogleAccount( { AccessToken: tokenResponse.access_token, // This access token is generated after a user has signed into Google CreateAccount: true, TitleId: import.meta.env.VITE_PLAYFAB_TITLE_ID, }, - async (response, error) => { + async (response?: { data: { SessionTicket: string } }, error?: Error) => { if (response) { try { const seqRes = await sequence.signIn( diff --git a/src/components/views/EmailConflictWarningView.tsx b/src/components/views/EmailConflictWarningView.tsx index f359832..5c94d13 100644 --- a/src/components/views/EmailConflictWarningView.tsx +++ b/src/components/views/EmailConflictWarningView.tsx @@ -1,4 +1,4 @@ -import { Box, Button, ChevronRightIcon, Text } from '@0xsequence/design-system' +import { Box, Button, Text } from '@0xsequence/design-system' interface PaneProps { onCancel: () => void