fix: 修复目录界面右上角菜单替换规则和字数统计切换无效

This commit is contained in:
HapeLee
2026-06-19 00:20:05 +08:00
parent 99e4961bbe
commit 2a4be52e2f
2 changed files with 9 additions and 5 deletions
@@ -152,8 +152,8 @@ fun TocScreen(
var editingBookmark by remember { mutableStateOf<Bookmark?>(null) } var editingBookmark by remember { mutableStateOf<Bookmark?>(null) }
val useReplace = viewModel.useReplace val useReplace = state.useReplace
val showWordCount = viewModel.showWordCount val showWordCount = state.showWordCount
val bookmarkManagementTitle = stringResource(R.string.bookmark_management) val bookmarkManagementTitle = stringResource(R.string.bookmark_management)
val locateCurrentReadingText = stringResource(R.string.locate_current_reading) val locateCurrentReadingText = stringResource(R.string.locate_current_reading)
val moveToTopText = stringResource(R.string.move_to_top) val moveToTopText = stringResource(R.string.move_to_top)
@@ -686,7 +686,7 @@ fun ChapterListContent(
.animateItem() .animateItem()
.fillMaxWidth(), .fillMaxWidth(),
item = uiItem, item = uiItem,
showWordCount = viewModel.showWordCount, showWordCount = state.showWordCount,
onClick = { onClick = {
if (state.selectedIds.isNotEmpty()) if (state.selectedIds.isNotEmpty())
viewModel.toggleSelection(uiItem.id) viewModel.toggleSelection(uiItem.id)
@@ -80,7 +80,9 @@ data class TocActionState(
override val searchKey: String = "", override val searchKey: String = "",
override val isSearch: Boolean = false, override val isSearch: Boolean = false,
override val isLoading: Boolean = false, override val isLoading: Boolean = false,
val downloadSummary: String = "" val downloadSummary: String = "",
val useReplace: Boolean = false,
val showWordCount: Boolean = true,
) : ListUiState<TocItemUi> ) : ListUiState<TocItemUi>
data class TocDomainItem( data class TocDomainItem(
@@ -347,7 +349,9 @@ class TocViewModel(
searchKey = _searchKey.value, searchKey = _searchKey.value,
isSearch = isSearch, isSearch = isSearch,
isLoading = isUploading, isLoading = isUploading,
downloadSummary = downloadSummary.value downloadSummary = downloadSummary.value,
useReplace = tocPreferences.value.useReplace,
showWordCount = tocPreferences.value.showWordCount,
) )
} }