فهرست منبع

refac: voice recording

Timothy Jaeryang Baek 4 ماه پیش
والد
کامیت
40a3e7786b
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      src/lib/components/chat/MessageInput/VoiceRecording.svelte

+ 4 - 1
src/lib/components/chat/MessageInput/VoiceRecording.svelte

@@ -159,7 +159,7 @@
 	};
 
 	const startRecording = async () => {
-		startDurationCounter();
+		loading = true;
 
 		stream = await navigator.mediaDevices.getUserMedia({
 			audio: {
@@ -171,6 +171,9 @@
 		mediaRecorder = new MediaRecorder(stream);
 		mediaRecorder.onstart = () => {
 			console.log('Recording started');
+			loading = false;
+			startDurationCounter();
+
 			audioChunks = [];
 			analyseAudio(stream);
 		};