Browse Source

Merge pull request #1954 from nextcloud/fix/voicerecorder

Voice memo timer starts before recording
Marino Faggiana 3 years ago
parent
commit
ec9c8938b3

+ 1 - 1
iOSClient/Main/AudioRecorder/NCAudioRecorderViewController.swift

@@ -93,7 +93,6 @@ class NCAudioRecorderViewController: UIViewController, NCAudioRecorderDelegate {
 
 
         if recording.state == .record {
         if recording.state == .record {
 
 
-            startDate = Date()
             recording.stop()
             recording.stop()
             voiceRecordHUD.update(0.0)
             voiceRecordHUD.update(0.0)
 
 
@@ -105,6 +104,7 @@ class NCAudioRecorderViewController: UIViewController, NCAudioRecorderDelegate {
 
 
             do {
             do {
                 try recording.record()
                 try recording.record()
+                startDate = Date()
                 startStopLabel.text = NSLocalizedString("_voice_memo_stop_", comment: "")
                 startStopLabel.text = NSLocalizedString("_voice_memo_stop_", comment: "")
             } catch {
             } catch {
                 print(error)
                 print(error)