Skip to content

Commit

Permalink
fix chat concurrent modification exception
Browse files Browse the repository at this point in the history
  • Loading branch information
crackededed committed Jan 29, 2025
1 parent 17646c0 commit 3751b32
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ android {
minSdk = 21
targetSdk = 35
versionCode = 121
versionName = "2.41.0"
versionName = "2.41.1"
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,9 @@ class ChatViewModel @Inject constructor(
}?.let { list.add(it) }
}
if (list.isNotEmpty()) {
_chatMessages.value = mutableListOf<ChatMessage>().apply {
_chatMessages.value = arrayListOf<ChatMessage>().apply {
addAll(list)
addAll(_chatMessages.value)
addAll(_chatMessages.value.toList())
}
if (!scrollDown.value) {
scrollDown.value = true
Expand Down Expand Up @@ -1044,7 +1044,7 @@ class ChatViewModel @Inject constructor(

private fun onClearMessage(message: String, nameDisplay: String?) {
val pair = ChatUtils.parseClearMessage(message)
val deletedMessage = pair.second?.let { targetId -> _chatMessages.value.find { it.id == targetId } }
val deletedMessage = pair.second?.let { targetId -> _chatMessages.value.toList().find { it.id == targetId } }
onMessage(getClearMessage(pair.first, deletedMessage, nameDisplay))
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
activity = "1.10.0"
android-gradle-plugin = "8.8.0"
apollo = "4.1.0"
apollo = "4.1.1"
appcompat = "1.7.0"
coil = "3.0.4"
constraintlayout = "2.2.0"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down

0 comments on commit 3751b32

Please sign in to comment.