diff --git a/app/src/main/kotlin/com/shonar/desktop/DesktopState.kt b/app/src/main/kotlin/com/shonar/desktop/DesktopState.kt index 6593e0c..0fa038e 100644 --- a/app/src/main/kotlin/com/shonar/desktop/DesktopState.kt +++ b/app/src/main/kotlin/com/shonar/desktop/DesktopState.kt @@ -1328,7 +1328,16 @@ class DesktopState(private val appDir: File = defaultAppDir()) { * [tone] (e.g. "sarcastic") restyles the voice; null = neutral. */ fun summarize(tone: String? = null) { val d = _detail.value ?: return - val remoteId = d.remoteId ?: loadMapping(d.file)?.recordingId ?: return + val remoteId = d.remoteId ?: loadMapping(d.file)?.recordingId + if (remoteId == null) { + // No server recording and no mapping: a silent return here + // looked like a broken button (seen with a detail screen + // opened for a since-renamed/deleted file). Say what's wrong. + d.error = "This file has no server recording to summarize — " + + "press Transcribe to upload it first." + _detail.value = d.copy() + return + } d.remoteId = remoteId reprocessInPlace(d, job = "summarize", tone = tone) } @@ -1342,7 +1351,13 @@ class DesktopState(private val appDir: File = defaultAppDir()) { */ fun saveTranscriptEdit(text: String) { val d = _detail.value ?: return - val remoteId = d.remoteId ?: loadMapping(d.file)?.recordingId ?: return + val remoteId = d.remoteId ?: loadMapping(d.file)?.recordingId + if (remoteId == null) { + d.error = "This file has no server recording to save against — " + + "press Transcribe to upload it first." + _detail.value = d.copy() + return + } d.remoteId = remoteId if (text.isBlank() || text == d.transcript?.text) return scope.launch {