mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 21:07:04 +05:30
fix(android): add missing user destination to search screen
Fixes COMPOSE-LOBSTERS-3V
This commit is contained in:
parent
55635f1101
commit
d8b2ff6c8d
2 changed files with 25 additions and 0 deletions
|
@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Navigating to user profiles now works when invoked from the search
|
||||||
|
results page
|
||||||
|
|
||||||
## [1.46.0] - 2024-04-24
|
## [1.46.0] - 2024-04-24
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -24,6 +24,7 @@ import dev.msfjarvis.claw.android.viewmodel.ClawViewModel
|
||||||
import dev.msfjarvis.claw.common.comments.CommentsPage
|
import dev.msfjarvis.claw.common.comments.CommentsPage
|
||||||
import dev.msfjarvis.claw.common.comments.HTMLConverter
|
import dev.msfjarvis.claw.common.comments.HTMLConverter
|
||||||
import dev.msfjarvis.claw.common.urllauncher.UrlLauncher
|
import dev.msfjarvis.claw.common.urllauncher.UrlLauncher
|
||||||
|
import dev.msfjarvis.claw.common.user.UserProfile
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun SearchScreen(
|
fun SearchScreen(
|
||||||
|
@ -74,6 +75,25 @@ fun SearchScreen(
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
composable(
|
||||||
|
route = Destinations.User.route,
|
||||||
|
arguments = listOf(navArgument("username") { type = NavType.StringType }),
|
||||||
|
) { backStackEntry ->
|
||||||
|
val username =
|
||||||
|
requireNotNull(backStackEntry.arguments?.getString("username")) {
|
||||||
|
"Navigating to ${Destinations.User.route} without necessary 'username' argument"
|
||||||
|
}
|
||||||
|
setWebUri("https://lobste.rs/u/$username")
|
||||||
|
UserProfile(
|
||||||
|
username = username,
|
||||||
|
getProfile = viewModel::getUserProfile,
|
||||||
|
openUserProfile = {
|
||||||
|
navController.navigate(
|
||||||
|
Destinations.User.route.replace(Destinations.User.PLACEHOLDER, it)
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue