mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 22:17:03 +05:30
fix(widget): open comments screen directly for lobsters-native posts
Fixes COMPOSE-LOBSTERS-2P
This commit is contained in:
parent
7762733da2
commit
5c0b5bb4f7
2 changed files with 8 additions and 2 deletions
|
@ -43,9 +43,10 @@ fun WidgetListEntry(post: UIPost, modifier: GlanceModifier = GlanceModifier) {
|
|||
val titleStyle = MaterialTheme.typography.titleMedium
|
||||
val commentsAction =
|
||||
actionStartActivity<MainActivity>(actionParametersOf(destinationKey to post.shortId))
|
||||
// If the URL starts with a /, it's a relative URL and we should open the comments page directly.
|
||||
val postAction =
|
||||
if (post.url.isNotEmpty()) actionStartActivity(Intent(Intent.ACTION_VIEW, Uri.parse(post.url)))
|
||||
else commentsAction
|
||||
if (post.url.startsWith('/')) commentsAction
|
||||
else actionStartActivity(Intent(Intent.ACTION_VIEW, Uri.parse(post.url)))
|
||||
Box(modifier.padding(8.dp)) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue