mirror of
https://github.com/CherretGit/zaprett-app.git
synced 2026-03-22 00:28:15 +05:00
fix error while checking updates
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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 }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user