Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update notification flow in initialization #167

Merged
merged 15 commits into from
Jul 9, 2024
Merged
Prev Previous commit
Next Next commit
refactor: internalStream === null
braden-w committed Jul 6, 2024
commit a7e0f4191585f8a29cd09da28c268ce57707a400
3 changes: 2 additions & 1 deletion apps/app/src/lib/services/MediaRecorderService.svelte.ts
Original file line number Diff line number Diff line change
@@ -66,7 +66,8 @@ const getFirstAvailableStream = Effect.gen(function* () {
export const mediaStream = Effect.gen(function* () {
let internalStream = $state<MediaStream | null>(null);
const destroy = () => {
internalStream?.getTracks().forEach((track) => track.stop());
if (internalStream === null) return;
internalStream.getTracks().forEach((track) => track.stop());
internalStream = null;
};
return {