add getUpdates by not user

This commit is contained in:
2026-07-26 00:27:38 +03:00
parent db6171b160
commit 51839829bd
@@ -45,11 +45,21 @@ class UpdateComponent(
}
}
fun checkUpdates() {
fun checkUpdates(byUser: Boolean = true) {
if (!hasSupport) return
scope.launch {
interactor.checkUpdate().collect {
isForceUpdate = (it as? UpdateState.UpdateAvailable)?.isForceUpdate ?: false
_state.value = it
_state.value = if (byUser) {
it
} else {
when (it) {
UpdateState.Checking,
UpdateState.UpToDate,
is UpdateState.Error -> UpdateState.Idle
else -> it
}
}
}
}
}