From 8b4bd76be1d2934461cf83a25cdece76fad94a9a Mon Sep 17 00:00:00 2001 From: Extremesecrecy <10959169+extremesecrecy@users.noreply.github.com> Date: Sun, 27 Jul 2025 07:43:01 -0700 Subject: [PATCH] Persist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pressing OK in the JACK server dialog now clears the stored original settings so the close handler doesn’t revert them, ensuring the new devices remain active --- vite/src/pipedal/JackServerSettingsDialog.tsx | 2 ++ vite/src/pipedal/PiPedalModel.tsx | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/vite/src/pipedal/JackServerSettingsDialog.tsx b/vite/src/pipedal/JackServerSettingsDialog.tsx index 8fd945c..5f7f7ce 100644 --- a/vite/src/pipedal/JackServerSettingsDialog.tsx +++ b/vite/src/pipedal/JackServerSettingsDialog.tsx @@ -561,6 +561,8 @@ const JackServerSettingsDialog = withStyles( } let s = this.state.jackServerSettings.clone(); s.valid = true; + // Accept the new settings so handleClose doesn't revert + this.originalJackServerSettings = undefined; this.props.onApply(s); diff --git a/vite/src/pipedal/PiPedalModel.tsx b/vite/src/pipedal/PiPedalModel.tsx index 0c7e486..176071c 100644 --- a/vite/src/pipedal/PiPedalModel.tsx +++ b/vite/src/pipedal/PiPedalModel.tsx @@ -2525,6 +2525,10 @@ export class PiPedalModel //implements PiPedalModel }); } setJackServerSettings(jackServerSettings: JackServerSettings): void { + // Update the local observable so the UI reflects the new selection + // immediately. Persist the settings via the websocket as well. + this.jackServerSettings.set(jackServerSettings.clone()); + this.webSocket?.request("setJackServerSettings", jackServerSettings) .catch((error) => { this.showAlert(error);