Skip to content

Commit a5ffd1a

Browse files
committed
(fix) recording actions animation
1 parent db88b2c commit a5ffd1a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/ChatWindow/Room/Room.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
v-if="showAudio && !imageFile && !videoFile"
142142
class="vac-icon-textarea-left"
143143
>
144-
<template v-if="recorder.isRecording">
144+
<template v-if="isRecording">
145145
<div
146146
class="vac-svg-button vac-icon-audio-stop"
147147
@click="stopRecorder"
@@ -402,6 +402,7 @@ export default {
402402
selectedUsersTag: [],
403403
textareaCursorPosition: null,
404404
recorder: this.initRecorder(),
405+
isRecording: false,
405406
bitRate: 128,
406407
sampleRate: 44100,
407408
format: 'mp3',
@@ -840,6 +841,8 @@ export default {
840841
setTimeout(() => (this.fileDialog = false), 500)
841842
},
842843
initRecorder() {
844+
this.isRecording = false
845+
843846
return new Recorder({
844847
beforeRecording: this.beforeRecording,
845848
afterRecording: this.afterRecording,
@@ -851,8 +854,10 @@ export default {
851854
})
852855
},
853856
toggleRecorder() {
857+
this.isRecording = !this.isRecording
858+
854859
if (!this.recorder.isRecording) {
855-
this.recorder.start()
860+
setTimeout(() => this.recorder.start(), 200)
856861
} else {
857862
this.recorder.stop()
858863
@@ -1088,15 +1093,16 @@ export default {
10881093
}
10891094
10901095
.vac-icon-audio-stop {
1091-
margin: 0 20px 0 10px;
1096+
margin-right: 20px;
10921097
10931098
::v-deep #vac-icon-close-outline {
10941099
fill: var(--chat-icon-color-audio-cancel);
10951100
}
10961101
}
10971102
10981103
.vac-icon-audio-confirm {
1099-
margin: 0 13px 0 12px;
1104+
margin-right: 3px;
1105+
margin-left: 12px;
11001106
11011107
::v-deep #vac-icon-checkmark {
11021108
fill: var(--chat-icon-color-audio-confirm);

0 commit comments

Comments
 (0)