+
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,22 @@ fun Base(
) { contentPadding ->
val isRefreshing by mainViewModel.isRefreshing.observeAsState()
val state = rememberPullToRefreshState()
if (state.isRefreshing) {
if (state.isRefreshing && !(isRefreshing ?: false)) {
LaunchedEffect(true) {
mainViewModel.refresh()
state.endRefresh()
}
} else if (!state.isRefreshing && (isRefreshing ?: false)) {
LaunchedEffect(true) {
state.startRefresh()
}
}
if (!(isRefreshing ?: false)) {
if (state.isRefreshing) {
LaunchedEffect(true) {
state.endRefresh()
mainViewModel.refresh()
// Due to the way compositing works, we cancel the refresh in the
// first if (even if the first if is moved below this one, and then
// we have no way to undo the cancel).
state.startRefresh()
}
}
Box(modifier = Modifier.nestedScroll(state.nestedScrollConnection).padding(contentPadding)) {
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载