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,13 +709,15 @@ 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")
if (cmd != null) {
processCommand(wv, cmd)
}
}
}
}
}
val assetLoader = WebViewAssetLoader.Builder()
.addPathHandler("/assets/www/", WebViewAssetLoader.AssetsPathHandler(LocalContext.current))
.build()

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,12 +195,14 @@ 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")
if (cmd != null) {
processCommand(cmd)
}
}
}
}
}
fun startServer(onResponse: (WVAPIMessage) -> Unit): NanoWSD {