fixing navigation issue

This commit is contained in:
Ryan Skinner
2024-05-22 16:38:10 -04:00
parent b25e1d5ece
commit ac692c77f5
+10 -4
View File
@@ -603,10 +603,10 @@ export function SearchScreen(
updateSearchHistory(item) updateSearchHistory(item)
if (isWeb) { if (isWeb) {
navigation.push('Search', {q: item}) navigation.replace('Search', {q: item})
} else { } else {
textInput.current?.blur() textInput.current?.blur()
navigation.setParams({q: item}) navigation.replace('Search', {q: item})
} }
}, },
[updateSearchHistory, navigation], [updateSearchHistory, navigation],
@@ -619,13 +619,19 @@ export function SearchScreen(
updateSelectedProfiles(profile) updateSelectedProfiles(profile)
if (isWeb) { if (isWeb) {
navigation.push('Profile', {name: profile.handle}) navigation.reset({
index: 1,
routes: [
{name: 'Search', params: {q: searchText}},
{name: 'Profile', params: {name: profile.handle}},
],
})
} else { } else {
textInput.current?.blur() textInput.current?.blur()
navigation.navigate('Profile', {name: profile.handle}) navigation.navigate('Profile', {name: profile.handle})
} }
}, },
[updateSelectedProfiles, navigation], [updateSelectedProfiles, navigation, searchText],
) )
const onSubmit = React.useCallback(() => { const onSubmit = React.useCallback(() => {