File tree Expand file tree Collapse file tree
app/src/main/java/com/nextcloud/talk/chat Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -629,8 +629,6 @@ class ChatActivity :
629629
630630 val visibleIds = listState.visibleItemsWithThreshold()
631631 LaunchedEffect (visibleIds, downloadingFileState.value) {
632- Log .d(" Julius" , " Visible Id: $visibleIds " )
633- Log .d(" Julius" , " Download state: ${downloadingFileState.value} " )
634632 openWhenDownloadState.value = (downloadingFileState.value.intersect(visibleIds).isNotEmpty())
635633 }
636634
@@ -701,10 +699,16 @@ class ChatActivity :
701699 var result: String? = null
702700 message?.let {
703701 if (message.messageParameters.isNotEmpty()) {
704- // TODO - fix this stupid casting logic to be more robust
705- val fileParameters =
706- FileParameters (message.messageParameters as HashMap <String ?, HashMap <String ?, String ?>>? )
707- result = fileParameters.id
702+ runCatching {
703+ message.messageParameters as HashMap <String ?, HashMap <String ?, String ?>>?
704+ val fileParameters = FileParameters (message.messageParameters)
705+ result = fileParameters.id
706+ }.onFailure { e ->
707+ when (e) {
708+ is ClassCastException -> {} // weird
709+ else -> Log .e(TAG , " Error in LazyListState.visibleItemsWithThreshold $e " )
710+ }
711+ }
708712 }
709713 }
710714
You can’t perform that action at this time.
0 commit comments