Fix scroll load articles
This commit is contained in:
		
							parent
							
								
									f668e7c329
								
							
						
					
					
						commit
						e9f7ac85ab
					
				@ -23,7 +23,7 @@ fun LazyListScope.generateArticleList(
 | 
				
			|||||||
    homeViewModel: HomeViewModel,
 | 
					    homeViewModel: HomeViewModel,
 | 
				
			||||||
    scope: CoroutineScope
 | 
					    scope: CoroutineScope
 | 
				
			||||||
) {
 | 
					) {
 | 
				
			||||||
    if (pagingItems == null) return
 | 
					    pagingItems ?: return
 | 
				
			||||||
    var lastItemDay: String? = null
 | 
					    var lastItemDay: String? = null
 | 
				
			||||||
    for (itemIndex in 0 until pagingItems.itemCount) {
 | 
					    for (itemIndex in 0 until pagingItems.itemCount) {
 | 
				
			||||||
        val currentItem = pagingItems.peek(itemIndex) ?: continue
 | 
					        val currentItem = pagingItems.peek(itemIndex) ?: continue
 | 
				
			||||||
@ -39,7 +39,7 @@ fun LazyListScope.generateArticleList(
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        item {
 | 
					        item {
 | 
				
			||||||
            ArticleItem(
 | 
					            ArticleItem(
 | 
				
			||||||
                articleWithFeed = currentItem,
 | 
					                articleWithFeed = pagingItems[itemIndex] ?: return@item,
 | 
				
			||||||
            ) {
 | 
					            ) {
 | 
				
			||||||
                readViewModel.dispatch(ReadViewAction.ScrollToItem(0))
 | 
					                readViewModel.dispatch(ReadViewAction.ScrollToItem(0))
 | 
				
			||||||
                readViewModel.dispatch(ReadViewAction.InitData(it))
 | 
					                readViewModel.dispatch(ReadViewAction.InitData(it))
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user