more fixes

This commit is contained in:
Avently 2025-03-22 03:05:09 +07:00
parent b67d85f4f5
commit 0215aa9d0e
3 changed files with 9 additions and 5 deletions

View file

@ -709,9 +709,11 @@ fun WebRTCView(callCommand: SnapshotStateList<WCallCommand>, onResponse: (WVAPIM
.filterNotNull()
.collect {
while (callCommand.isNotEmpty()) {
val cmd = callCommand.removeFirst()
val cmd = callCommand.removeFirstOrNull()
Log.d(TAG, "WebRTCView LaunchedEffect executing $cmd")
processCommand(wv, cmd)
if (cmd != null) {
processCommand(wv, cmd)
}
}
}
}

View file

@ -173,7 +173,7 @@ private fun ApplicationScope.AppWindow(closedByError: MutableState<Boolean>) {
// Shows toast in insertion order with preferred delay per toast. New one will be shown once previous one expires
LaunchedEffect(toast, toasts.size) {
delay(toast.second)
simplexWindowState.toasts.removeFirst()
simplexWindowState.toasts.removeFirstOrNull()
}
}
var windowFocused by remember { simplexWindowState.windowFocused }

View file

@ -195,9 +195,11 @@ fun WebRTCController(callCommand: SnapshotStateList<WCallCommand>, onResponse: (
delay(100)
}
while (callCommand.isNotEmpty()) {
val cmd = callCommand.removeFirst()
val cmd = callCommand.removeFirstOrNull()
Log.d(TAG, "WebRTCController LaunchedEffect executing $cmd")
processCommand(cmd)
if (cmd != null) {
processCommand(cmd)
}
}
}
}