141
141
v-if =" showAudio && !imageFile && !videoFile"
142
142
class =" vac-icon-textarea-left"
143
143
>
144
- <template v-if =" recorder . isRecording " >
144
+ <template v-if =" isRecording " >
145
145
<div
146
146
class =" vac-svg-button vac-icon-audio-stop"
147
147
@click =" stopRecorder"
@@ -402,6 +402,7 @@ export default {
402
402
selectedUsersTag: [],
403
403
textareaCursorPosition: null ,
404
404
recorder: this .initRecorder (),
405
+ isRecording: false ,
405
406
bitRate: 128 ,
406
407
sampleRate: 44100 ,
407
408
format: ' mp3' ,
@@ -840,6 +841,8 @@ export default {
840
841
setTimeout (() => (this .fileDialog = false ), 500 )
841
842
},
842
843
initRecorder () {
844
+ this .isRecording = false
845
+
843
846
return new Recorder ({
844
847
beforeRecording: this .beforeRecording ,
845
848
afterRecording: this .afterRecording ,
@@ -851,8 +854,10 @@ export default {
851
854
})
852
855
},
853
856
toggleRecorder () {
857
+ this .isRecording = ! this .isRecording
858
+
854
859
if (! this .recorder .isRecording ) {
855
- this .recorder .start ()
860
+ setTimeout (() => this .recorder .start (), 200 )
856
861
} else {
857
862
this .recorder .stop ()
858
863
@@ -1088,15 +1093,16 @@ export default {
1088
1093
}
1089
1094
1090
1095
.vac-icon-audio-stop {
1091
- margin : 0 20px 0 10 px ;
1096
+ margin-right : 20px ;
1092
1097
1093
1098
::v- deep #vac- icon- close- outline {
1094
1099
fill : var (--chat-icon-color-audio-cancel );
1095
1100
}
1096
1101
}
1097
1102
1098
1103
.vac-icon-audio-confirm {
1099
- margin : 0 13px 0 12px ;
1104
+ margin-right : 3px ;
1105
+ margin-left : 12px ;
1100
1106
1101
1107
::v- deep #vac- icon- checkmark {
1102
1108
fill : var (--chat-icon-color-audio-confirm );
0 commit comments