From ccaadf1e3812a05888c538f91eb536dd75f6f491 Mon Sep 17 00:00:00 2001 From: Extremesecrecy <10959169+extremesecrecy@users.noreply.github.com> Date: Fri, 25 Jul 2025 17:08:23 -0700 Subject: [PATCH] Retain settings When reopening the JACK server settings dialog, the selected settings now remain intact. The dialog only applies device defaults after ALSA information has loaded, preserving current values otherwise --- vite/src/pipedal/JackServerSettingsDialog.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/vite/src/pipedal/JackServerSettingsDialog.tsx b/vite/src/pipedal/JackServerSettingsDialog.tsx index d1c4325..f2d0b5d 100644 --- a/vite/src/pipedal/JackServerSettingsDialog.tsx +++ b/vite/src/pipedal/JackServerSettingsDialog.tsx @@ -445,16 +445,22 @@ const JackServerSettingsDialog = withStyles( } componentDidUpdate(oldProps: JackServerSettingsDialogProps) { if ((this.props.open && !oldProps.open) && this.mounted) { - let settings = this.applyAlsaDevices(this.props.jackServerSettings.clone(), this.state.alsaDevices); - this.setState({ + // When opening, preserve the current settings until ALSA device + // information is loaded. If we don't have device info yet, just + // clone the provided settings without applying device defaults. + let settings = this.state.alsaDevices + ? this.applyAlsaDevices(this.props.jackServerSettings.clone(), this.state.alsaDevices) + : this.props.jackServerSettings.clone(); + + this.setState({ jackServerSettings: settings, latencyText: getLatencyText(settings), - okEnabled: isOkEnabled(settings,this.state.alsaDevices) - }); + okEnabled: isOkEnabled(settings, this.state.alsaDevices) + }); if (!this.state.alsaDevices) { this.requestAlsaInfo(); } - this.startStatusTimer(); + this.startStatusTimer(); } else if (!this.props.open && oldProps.open) { this.stopStatusTimer(); }