From 8ad174b0af98d8b289748f9d155bff9153cb5438 Mon Sep 17 00:00:00 2001 From: Kevin Thomas Date: Sat, 30 Apr 2022 21:07:41 -0700 Subject: [PATCH] Add recording function improvements --- src/components/Noise.vue | 9 ++++++++- src/components/noise.js | 11 +++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/components/Noise.vue b/src/components/Noise.vue index 1136d37..97aadfb 100644 --- a/src/components/Noise.vue +++ b/src/components/Noise.vue @@ -339,6 +339,7 @@ @@ -349,11 +350,17 @@ + + Cancel + - Stop + Stop and Save diff --git a/src/components/noise.js b/src/components/noise.js index ae80690..2aee06e 100644 --- a/src/components/noise.js +++ b/src/components/noise.js @@ -727,6 +727,7 @@ export default { async stopRecording () { const recording = await this.recorder.stop() + // Set active profile back to the selected one this.loadProfile() const url = URL.createObjectURL(recording) @@ -735,6 +736,16 @@ export default { anchor.href = url anchor.click() + clearInterval(this.recordingInterval) + this.recordingDialog = false + this.stop() + }, + async cancelRecording () { + await this.recorder.stop() + + // Set active profile back to the selected one + this.loadProfile() + clearInterval(this.recordingInterval) this.recordingDialog = false this.stop()