From 1ab3e39ba0eb64617f6350affcfd80f00747a94b Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Mon, 15 Apr 2024 12:58:04 +0200 Subject: [PATCH] Fix datarhei/restreamer#710 --- src/views/Edit/Profile.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/views/Edit/Profile.js b/src/views/Edit/Profile.js index b7aa583..13c45fc 100644 --- a/src/views/Edit/Profile.js +++ b/src/views/Edit/Profile.js @@ -333,14 +333,18 @@ export default function Profile(props) { } }; - const handleStreamSelect = (type) => (stream) => { - const profile = $profile[type]; + const handleStreamSelect = (type, what) => (stream) => { + const profile = $profile; - profile.stream = stream; + profile[type].stream = stream; + + if (what === 'custom') { + profile.custom.stream = stream; + } setProfile({ ...$profile, - [type]: profile, + ...profile, }); }; @@ -493,7 +497,7 @@ export default function Profile(props) { type="audio" streams={$sources.video.streams} selected={$profile.custom.stream} - onChange={handleStreamSelect('audio')} + onChange={handleStreamSelect('audio', 'custom')} />