release: v1.7.24 – ResourceDetailScreen with markdown rendering
This commit is contained in:
parent
26117ac23f
commit
c24a32b033
3 changed files with 18 additions and 3 deletions
|
|
@ -15,8 +15,8 @@ android {
|
|||
applicationId = "de.bollwerk.app"
|
||||
minSdk = 26
|
||||
targetSdk = 35
|
||||
versionCode = 23
|
||||
versionName = "1.7.23"
|
||||
versionCode = 24
|
||||
versionName = "1.7.24"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
buildConfigField("boolean", "FEATURE_CAMERA_ENABLED", "false")
|
||||
|
|
|
|||
|
|
@ -109,6 +109,14 @@ internal fun ResourceListScreen(
|
|||
}
|
||||
}
|
||||
|
||||
// Show error message from refresh
|
||||
uiState.errorMessage?.let { msg ->
|
||||
LaunchedEffect(msg) {
|
||||
snackbarHostState.showSnackbar(msg)
|
||||
viewModel.clearError()
|
||||
}
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
topBar = {
|
||||
TopAppBar(
|
||||
|
|
|
|||
|
|
@ -36,7 +36,8 @@ internal data class ResourceListUiState(
|
|||
val sortMode: SortMode = SortMode.TITLE_ASC,
|
||||
val isLoading: Boolean = false,
|
||||
val allTags: List<String> = emptyList(),
|
||||
val downloadStates: Map<String, DownloadState> = emptyMap()
|
||||
val downloadStates: Map<String, DownloadState> = emptyMap(),
|
||||
val errorMessage: String? = null
|
||||
)
|
||||
|
||||
@HiltViewModel
|
||||
|
|
@ -62,6 +63,8 @@ internal class ResourceListViewModel @Inject constructor(
|
|||
_uiState.update { it.copy(isLoading = true) }
|
||||
try {
|
||||
resourceRepository.refreshFromServer()
|
||||
} catch (_: Exception) {
|
||||
_uiState.update { it.copy(errorMessage = "Aktualisierung fehlgeschlagen") }
|
||||
} finally {
|
||||
_uiState.update { it.copy(isLoading = false) }
|
||||
}
|
||||
|
|
@ -117,4 +120,8 @@ internal class ResourceListViewModel @Inject constructor(
|
|||
state.copy(downloadStates = state.downloadStates + (guid to DownloadState.Idle))
|
||||
}
|
||||
}
|
||||
|
||||
fun clearError() {
|
||||
_uiState.update { it.copy(errorMessage = null) }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue