Browse Source

fix: voice note mic not stopping issue

Timothy J. Baek 6 tháng trước cách đây
mục cha
commit
466eea1a4c

+ 7 - 0
src/lib/components/chat/MessageInput/VoiceRecording.svelte

@@ -269,6 +269,13 @@
 			await mediaRecorder.stop();
 		}
 		clearInterval(durationCounter);
+
+		if (stream) {
+			const tracks = stream.getTracks();
+			tracks.forEach((track) => track.stop());
+		}
+
+		stream = null;
 	};
 </script>