Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix: remove skipVerifyCode opt" #108

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/components/Pages/RequestPage/RequestPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ export const RequestPage = () => {

// Show different views depending on the request method.
if (request.method === 'dcl_personal_sign') {
setView(View.VERIFY_SIGN_IN)
if (targetConfig.skipVerifyCode) {
onApproveSignInVerification()
} else {
setView(View.VERIFY_SIGN_IN)
}
} else {
setView(View.WALLET_INTERACTION)
}
Expand Down Expand Up @@ -154,9 +158,11 @@ export const RequestPage = () => {
}, [])

const onApproveSignInVerification = useCallback(async () => {
getAnalytics().track(TrackingEvents.CLICK, {
action: ClickEvents.APPROVE_SING_IN
})
if (!targetConfig.skipVerifyCode) {
getAnalytics().track(TrackingEvents.CLICK, {
action: ClickEvents.APPROVE_SING_IN
})
}
setIsLoading(true)
const provider = providerRef.current
try {
Expand Down
3 changes: 3 additions & 0 deletions src/hooks/targetConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@ import { useLocation } from 'react-router-dom'

type TargetConfigId = 'default' | 'alternative'
type TargetConfig = {
skipVerifyCode: boolean
skipSetup: boolean
showWearablePreview: boolean
explorerText: string
}

const targetConfigRecord: Record<TargetConfigId, TargetConfig> = {
default: {
skipVerifyCode: false,
skipSetup: false,
showWearablePreview: true,
explorerText: 'Desktop App'
},
alternative: {
skipVerifyCode: true,
skipSetup: true,
showWearablePreview: false,
explorerText: 'Explorer'
Expand Down
Loading