Лаб 5: фикс
This commit is contained in:
parent
1b14d0c301
commit
0f3829e6ea
@ -22,7 +22,7 @@ class CategoryRepository @Inject constructor(
|
|||||||
@OptIn(ExperimentalPagingApi::class)
|
@OptIn(ExperimentalPagingApi::class)
|
||||||
fun getAllPaged(token: String): Flow<PagingData<Category>> = Pager(
|
fun getAllPaged(token: String): Flow<PagingData<Category>> = Pager(
|
||||||
config = PagingConfig(
|
config = PagingConfig(
|
||||||
pageSize = 3,
|
pageSize = 20,
|
||||||
enablePlaceholders = false
|
enablePlaceholders = false
|
||||||
),
|
),
|
||||||
pagingSourceFactory = categoryDao::getPaged,
|
pagingSourceFactory = categoryDao::getPaged,
|
||||||
|
@ -96,7 +96,7 @@ fun EditMenuCategoryProductsCard(
|
|||||||
){
|
){
|
||||||
val productListUiState = menuViewModel.getProductsByCategoryId(category.id!!, searchToken).collectAsState(initial = listOf())
|
val productListUiState = menuViewModel.getProductsByCategoryId(category.id!!, searchToken).collectAsState(initial = listOf())
|
||||||
|
|
||||||
if (productListUiState.value?.size != 0){
|
if (productListUiState.value!= null){
|
||||||
Text(
|
Text(
|
||||||
text = category.name,
|
text = category.name,
|
||||||
color = Color.Black,
|
color = Color.Black,
|
||||||
|
@ -92,7 +92,7 @@ fun MenuCategoryProductsCard(
|
|||||||
){
|
){
|
||||||
val productListUiState = menuViewModel.getProductsByCategoryId(category.id!!, searchToken).collectAsState(initial = listOf())
|
val productListUiState = menuViewModel.getProductsByCategoryId(category.id!!, searchToken).collectAsState(initial = listOf())
|
||||||
|
|
||||||
if (productListUiState.value?.size != 0){
|
if (productListUiState.value != null){
|
||||||
Text(
|
Text(
|
||||||
text = category.name,
|
text = category.name,
|
||||||
color = Color.Black,
|
color = Color.Black,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user