fix: show toast when Live Call unavailable instead of silent no-op

The call button did nothing when no live model was available (empty
lambda). Now shows a toast explaining the issue.
This commit is contained in:
Bruno Deanoz 2026-06-24 07:12:13 +02:00
parent da3eded81e
commit 392e582084
3 changed files with 3 additions and 1 deletions

View file

@ -1359,7 +1359,7 @@ fun ChatScreen(
isRecording = isRecording, isRecording = isRecording,
recordingAmplitude = recordingAmplitude, recordingAmplitude = recordingAmplitude,
onMicClick = { toggleRecording() }, onMicClick = { toggleRecording() },
onCallClick = if (liveAvailable) {{ startLiveCall() }} else {{ /* PTT TODO */ }}, onCallClick = if (liveAvailable) {{ startLiveCall() }} else {{ Toast.makeText(context, context.getString(R.string.chat_call_unavailable), Toast.LENGTH_SHORT).show() }},
pendingFiles = pendingFiles, pendingFiles = pendingFiles,
onAddClick = { showAttachMenu = !showAttachMenu }, onAddClick = { showAttachMenu = !showAttachMenu },
onRemoveFile = { id -> pendingFiles.removeAll { it.id == id } }, onRemoveFile = { id -> pendingFiles.removeAll { it.id == id } },

View file

@ -15,6 +15,7 @@
<string name="chat_search">Search…</string> <string name="chat_search">Search…</string>
<string name="chat_attachment">Attachment</string> <string name="chat_attachment">Attachment</string>
<string name="chat_call">Call</string> <string name="chat_call">Call</string>
<string name="chat_call_unavailable">Live Call unavailable — no live model in Vertex region</string>
<string name="chat_remove">Remove</string> <string name="chat_remove">Remove</string>
<string name="chat_error">Error</string> <string name="chat_error">Error</string>
<string name="chat_open_menu">Open menu</string> <string name="chat_open_menu">Open menu</string>

View file

@ -17,6 +17,7 @@
<string name="chat_search">Suchen…</string> <string name="chat_search">Suchen…</string>
<string name="chat_attachment">Anhang</string> <string name="chat_attachment">Anhang</string>
<string name="chat_call">Anruf</string> <string name="chat_call">Anruf</string>
<string name="chat_call_unavailable">Live Call nicht verfügbar — kein Live-Modell in der Vertex-Region</string>
<string name="chat_remove">Entfernen</string> <string name="chat_remove">Entfernen</string>
<string name="chat_error">Fehler</string> <string name="chat_error">Fehler</string>
<string name="chat_open_menu">Menü öffnen</string> <string name="chat_open_menu">Menü öffnen</string>