forked from agzam/vyatsu-schedule
fix: ssl error & offline teacher schedule
This commit is contained in:
@@ -146,7 +146,15 @@ class PickerViewModel(
|
||||
syncJob = viewModelScope.launch {
|
||||
try {
|
||||
teacherScheduleRepository.syncPeriod(today).collect { progress ->
|
||||
_uiState.value = _uiState.value.copy(syncProgress = progress)
|
||||
_uiState.value = _uiState.value.copy(
|
||||
syncProgress = progress,
|
||||
error = if (progress.failed > 0) {
|
||||
"Не удалось загрузить расписание: ${progress.failed} из " +
|
||||
"${progress.total} кафедр. Проверьте подключение к интернету."
|
||||
} else {
|
||||
_uiState.value.error
|
||||
}
|
||||
)
|
||||
}
|
||||
} catch (e: CancellationException) {
|
||||
throw e
|
||||
|
||||
Reference in New Issue
Block a user