Skip to content

Commit 3ca2049

Browse files
committed
Configure other wab providers
remove debugs
1 parent 4046abd commit 3ca2049

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

app/index.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useState } from 'react'
1+
import React, { useEffect, useState, useCallback } from 'react'
22
import { View, Text, StyleSheet, TouchableOpacity, SafeAreaView, Alert, ActivityIndicator } from 'react-native'
33
import ConfigModal from '@/components/ConfigModal'
44
import { router } from 'expo-router'
@@ -36,7 +36,7 @@ export default function LoginScreen() {
3636
}, [])
3737

3838
// Navigate to phone auth screen
39-
const handleGetStarted = async () => {
39+
const handleGetStarted = useCallback(async () => {
4040
try {
4141
await analytics().logEvent('get_started_tapped', {
4242
screen: 'onboarding'
@@ -53,7 +53,6 @@ export default function LoginScreen() {
5353
throw new Error(`Failed to fetch info: ${res.status}`)
5454
}
5555
const wabInfo = await res.json()
56-
console.log({ wabInfo, selectedWabUrl, selectedMethod, selectedNetwork, selectedStorageUrl })
5756
const finalConfig = {
5857
wabUrl: selectedWabUrl,
5958
wabInfo,
@@ -85,7 +84,7 @@ export default function LoginScreen() {
8584
} finally {
8685
setLoading(false)
8786
}
88-
}
87+
}, [selectedWabUrl, selectedMethod, selectedNetwork, selectedStorageUrl, finalizeConfig, setItem, getSnap, managers?.walletManager])
8988

9089
// Config modal state
9190
const [showConfig, setShowConfig] = useState(false)
@@ -102,11 +101,8 @@ export default function LoginScreen() {
102101
const handleConfigured = async () => {
103102
// After successful config, proceed with auth
104103
try {
105-
const finalConfig = JSON.parse((await getItem('finalConfig')) || '')
106-
const success = finalizeConfig(finalConfig)
107-
if (!success) {
108-
return
109-
}
104+
// The ConfigModal has already called finalizeConfig() with the new configuration
105+
// No need to load from storage - the wallet context already has the updated values
110106
const snap = await getSnap()
111107
if (!snap) {
112108
router.push('/auth/phone')
@@ -205,6 +201,12 @@ export default function LoginScreen() {
205201
</>
206202
)}
207203
</View>
204+
205+
<ConfigModal
206+
visible={showConfig}
207+
onDismiss={handleConfigDismiss}
208+
onConfigured={handleConfigured}
209+
/>
208210
</SafeAreaView>
209211
)
210212
}

context/WalletContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ export const WalletContextProvider: React.FC<WalletContextProps> = ({ children =
742742
passwordRetriever,
743743
recoveryKeySaver,
744744
configStatus,
745-
managers.walletManager,
745+
walletBuilt,
746746
selectedNetwork,
747747
selectedWabUrl,
748748
buildWallet,

0 commit comments

Comments
 (0)