Skip to content

Commit

Permalink
Add hasSeed parameter to initialParams
Browse files Browse the repository at this point in the history
  • Loading branch information
KKA11010 committed Feb 6, 2024
1 parent 3e80007 commit 192e69f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/components/nav/Navigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export default function Navigator({
initialParams={{
sawSeedUpdate: sawSeedUpdate,
comingFromOnboarding: false,
hasSeed: hasSeed,
}}
/>
<Stack.Screen name='Recover' component={RecoverScreen} />
Expand Down
1 change: 1 addition & 0 deletions src/model/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ export type RootStackParamList = {
Seed: {
comingFromOnboarding?: boolean
sawSeedUpdate?: boolean
hasSeed?: boolean
} | undefined
'Select recovery mint': {
comingFromOnboarding?: boolean
Expand Down
1 change: 0 additions & 1 deletion src/screens/Payment/Processing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ export default function ProcessingScreen({ navigation, route }: TProcessingPageP
const { mints, highestBalance, highestBalanceMint } = await getHighestBalMint()
// if highest balance + estFee is sufficient, use it
if (highestBalanceMint) {
// TODO need to handle the case where the highest balance mint is not reachable?
const estFee = await checkFees(highestBalanceMint.mintUrl, recipient)
if (highestBalance + estFee >= amount) {
return navigation.navigate('coinSelection', {
Expand Down
11 changes: 9 additions & 2 deletions src/screens/Restore/Seed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Txt from '@comps/Txt'
import type { ISeedPageProps } from '@model/nav'
import { useThemeContext } from '@src/context/Theme'
import { NS } from '@src/i18n'
import { l } from '@src/logger'
import { store } from '@store'
import { STORE_KEYS } from '@store/consts'
import { globals, mainColors } from '@styles'
Expand All @@ -21,6 +22,12 @@ export default function SeedScreen({ navigation, route: { params } }: ISeedPageP
const { color } = useThemeContext()
const [infoOpen, setInfoOpen] = useState(false)

l({
sawSeedUpdate: params?.sawSeedUpdate,
comingFromOnboarding: params?.comingFromOnboarding,
hasSeed: params?.hasSeed,
})

return (
<SafeAreaView style={{ flex: 1, backgroundColor: color.BACKGROUND }}>
<View style={styles.header}>
Expand Down Expand Up @@ -69,7 +76,7 @@ export default function SeedScreen({ navigation, route: { params } }: ISeedPageP
</TouchableOpacity>
<Separator style={[styles.separator]} />
{/* quick wallet */}
{params?.comingFromOnboarding &&
{params?.comingFromOnboarding && !params?.hasSeed &&
<>
<TouchableOpacity
onPress={() => {
Expand Down Expand Up @@ -114,7 +121,7 @@ export default function SeedScreen({ navigation, route: { params } }: ISeedPageP
</View>
</TouchableOpacity>
{/* skip seed setup */}
{!params?.sawSeedUpdate &&
{!params?.comingFromOnboarding && !params?.hasSeed &&
<>
<Separator style={[styles.separator]} />
<TouchableOpacity
Expand Down

0 comments on commit 192e69f

Please sign in to comment.