From 53282d11c9ef1716c68c59b8190cefa45d582efd Mon Sep 17 00:00:00 2001 From: Extremesecrecy <10959169+extremesecrecy@users.noreply.github.com> Date: Thu, 24 Jul 2025 12:25:09 -0700 Subject: [PATCH] Update JackServerSettingsDialog.tsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit only clear the ALSA device fields when you uncheck the box, still refresh the device list (via requestAlsaInfo()) but preserve the checkbox state (so it doesn’t get recalculated back to true) --- vite/src/pipedal/JackServerSettingsDialog.tsx | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/vite/src/pipedal/JackServerSettingsDialog.tsx b/vite/src/pipedal/JackServerSettingsDialog.tsx index 319994e..18c19ff 100644 --- a/vite/src/pipedal/JackServerSettingsDialog.tsx +++ b/vite/src/pipedal/JackServerSettingsDialog.tsx @@ -300,8 +300,7 @@ const JackServerSettingsDialog = withStyles( alsaDevices: devices, jackServerSettings: settings, latencyText: getLatencyText(settings), - okEnabled: isOkEnabled(settings,devices), - useSameDevice: settings.alsaInputDevice === settings.alsaOutputDevice + okEnabled: isOkEnabled(settings,devices) }); } else { this.setState({ alsaDevices: devices }); @@ -504,25 +503,27 @@ const JackServerSettingsDialog = withStyles( okEnabled: isOkEnabled(settings, this.state.alsaDevices) }); } - handleUseSameDeviceChanged(e: any, checked: boolean) { - let s = this.state.jackServerSettings.clone(); - const useSame = checked; - - // release previous selection + handleUseSameDeviceChanged(e: any, checked: boolean) { + let s = this.state.jackServerSettings.clone(); + const useSame = checked; + + if (!useSame) { + // clear selections when switching to separate devices s.alsaInputDevice = INVALID_DEVICE_ID; s.alsaOutputDevice = INVALID_DEVICE_ID; s.valid = false; - - let settings = this.applyAlsaDevices(s, this.state.alsaDevices, useSame); - this.setState({ - useSameDevice: useSame, - jackServerSettings: settings, - latencyText: getLatencyText(settings), - okEnabled: isOkEnabled(settings, this.state.alsaDevices) - }, () => { - this.requestAlsaInfo(); - }); } + + let settings = this.applyAlsaDevices(s, this.state.alsaDevices, useSame); + this.setState({ + useSameDevice: useSame, + jackServerSettings: settings, + latencyText: getLatencyText(settings), + okEnabled: isOkEnabled(settings, this.state.alsaDevices) + }, () => { + this.requestAlsaInfo(); + }); + } render() { const classes = withStyles.getClasses(this.props);