Skip to content

Commit

Permalink
fix: Fix pulltorefresh indicator not visible when refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
kongwoojin committed Apr 1, 2024
1 parent ca573b8 commit 6ecb3c1
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ fun BoardContent(

LaunchedEffect(key1 = department.name, key2 = department.boards[page].board) {
boardViewModel.getAPI(department.name, department.boards[page].board)
pullToRefreshState.startRefresh()
}

val uiState by boardViewModel.collectAsState()
Expand All @@ -225,7 +224,18 @@ fun BoardContent(
}

LaunchedEffect(key1 = lazyPostList.loadState.append is LoadState.Loading) {
if (lazyPostList.loadState.refresh is LoadState.Loading) return@LaunchedEffect
if (lazyPostList.loadState.append is LoadState.Loading) {
pullToRefreshState.startRefresh()
return@LaunchedEffect
}
pullToRefreshState.endRefresh()
}

LaunchedEffect(key1 = lazyPostList.loadState.refresh is LoadState.Loading) {
if (lazyPostList.loadState.refresh is LoadState.Loading) {
pullToRefreshState.startRefresh()
return@LaunchedEffect
}
pullToRefreshState.endRefresh()
}

Expand Down

0 comments on commit 6ecb3c1

Please sign in to comment.