diff --git a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/history/HistoryPage.kt b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/history/HistoryPage.kt index 6b2fa95b..123d7ab5 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/history/HistoryPage.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/history/HistoryPage.kt @@ -21,6 +21,7 @@ import com.google.accompanist.pager.HorizontalPager import com.google.accompanist.pager.rememberPagerState import com.huanchengfly.tieba.post.R import com.huanchengfly.tieba.post.ui.common.theme.compose.ExtendedTheme +import com.huanchengfly.tieba.post.ui.page.ProvideNavigator import com.huanchengfly.tieba.post.ui.page.history.list.HistoryListPage import com.huanchengfly.tieba.post.ui.widgets.compose.BackNavigationIcon import com.huanchengfly.tieba.post.ui.widgets.compose.MyScaffold @@ -113,6 +114,7 @@ fun HistoryPage( } } ) { + ProvideNavigator(navigator = navigator) { HorizontalPager( count = 2, state = pagerState, @@ -125,6 +127,7 @@ fun HistoryPage( } else { HistoryListPage(type = HistoryUtil.TYPE_FORUM) } + } } } } \ No newline at end of file diff --git a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/history/list/HistoryListPage.kt b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/history/list/HistoryListPage.kt index 795df75f..33f0f927 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/history/list/HistoryListPage.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/history/list/HistoryListPage.kt @@ -30,6 +30,8 @@ import com.huanchengfly.tieba.post.fromJson import com.huanchengfly.tieba.post.models.ThreadHistoryInfoBean import com.huanchengfly.tieba.post.models.database.History import com.huanchengfly.tieba.post.ui.common.theme.compose.ExtendedTheme +import com.huanchengfly.tieba.post.ui.page.LocalNavigator +import com.huanchengfly.tieba.post.ui.page.destinations.ForumPageDestination import com.huanchengfly.tieba.post.ui.widgets.Chip import com.huanchengfly.tieba.post.ui.widgets.compose.Avatar import com.huanchengfly.tieba.post.ui.widgets.compose.LazyLoad @@ -74,6 +76,7 @@ fun HistoryListPage( ) val context = LocalContext.current + val navigator = LocalNavigator.current val snackbarHostState = LocalSnackbarHostState.current LaunchedEffect(null) { onEvent(viewModel) { @@ -123,10 +126,9 @@ fun HistoryListPage( }, onClick = { when (it.type) { - HistoryUtil.TYPE_FORUM -> ForumActivity.launch( - context, - it.data - ) + HistoryUtil.TYPE_FORUM -> { + navigator.navigate(ForumPageDestination(it.data)) + } HistoryUtil.TYPE_THREAD -> { val extra =