fix error while checking updates

This commit is contained in:
CherretGit
2026-03-19 23:19:15 +07:00
parent 490709384e
commit 154d8214bb
2 changed files with 6 additions and 4 deletions

View File

@@ -82,6 +82,7 @@ import com.cherret.zaprett.ui.viewmodel.HomeViewModel
import com.cherret.zaprett.utils.getServiceType
import dev.jeziellago.compose.markdowntext.MarkdownText
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
@OptIn(ExperimentalMaterial3Api::class)
@Composable
@@ -103,9 +104,9 @@ fun HomeScreen(viewModel: HomeViewModel = viewModel(), vpnLauncher: ActivityResu
val serviceMode = viewModel.serviceMode
val error by viewModel.errorFlow.collectAsState()
LaunchedEffect(Unit) {
viewModel.checkForUpdate()
viewModel.checkServiceStatus()
viewModel.checkModuleInfo()
launch { viewModel.checkForUpdate() }
launch { viewModel.checkServiceStatus() }
launch { viewModel.checkModuleInfo() }
}
LaunchedEffect(requestVpnPermission) {

View File

@@ -13,6 +13,7 @@ import io.ktor.client.HttpClient
import io.ktor.client.engine.okhttp.OkHttp
import io.ktor.client.request.get
import io.ktor.client.statement.bodyAsText
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.coroutineScope
@@ -88,6 +89,6 @@ object NetworkUtils {
updateInfo,
changeLog
)
}
}.onFailure { if (it is CancellationException) throw it }
}
}