mirror of
https://github.com/VibedByKaKi/t3-code-android-nightly.git
synced 2026-10-09 03:41:17 +02:00
25 lines
968 B
Diff
25 lines
968 B
Diff
diff --git a/ios/AudioRecorder.swift b/ios/AudioRecorder.swift
|
|
index 73c6a036be6c76e219774a8d1e1cc3a7f18e6f8e..edfbbe00c2b0f3544bcbe42d02b829bf310d241c 100644
|
|
--- a/ios/AudioRecorder.swift
|
|
+++ b/ios/AudioRecorder.swift
|
|
@@ -268,16 +268,16 @@ class AudioRecorder: SharedRef<AVAudioRecorder>, RecordingResultHandler {
|
|
}
|
|
|
|
func didFinish(_ recorder: AVAudioRecorder, successfully flag: Bool) {
|
|
- // Update internal state when recording finishes automatically (e.g., from recordForDuration)
|
|
- currentState = .stopped
|
|
+ // Update internal state when AVAudioRecorder finishes or fails.
|
|
+ currentState = flag ? .stopped : .error
|
|
resetDurationTracking()
|
|
durationLimitSeconds = nil
|
|
|
|
emit(event: recordingStatus, payload: [
|
|
"id": id,
|
|
"isFinished": true,
|
|
- "hasError": false,
|
|
- "error": nil,
|
|
+ "hasError": !flag,
|
|
+ "error": flag ? nil : "Recording failed",
|
|
"url": recorder.url.absoluteString
|
|
])
|
|
}
|