From 8f6ca6758342966d7c47894f02d1f9d9bb10230e Mon Sep 17 00:00:00 2001 From: Extremesecrecy <10959169+extremesecrecy@users.noreply.github.com> Date: Sun, 27 Jul 2025 19:16:26 -0700 Subject: [PATCH] Update JackServerSettingsDialog.tsx Fire and forget websocket on apply --- vite/src/pipedal/JackServerSettingsDialog.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/vite/src/pipedal/JackServerSettingsDialog.tsx b/vite/src/pipedal/JackServerSettingsDialog.tsx index cfeeab4..0deda47 100644 --- a/vite/src/pipedal/JackServerSettingsDialog.tsx +++ b/vite/src/pipedal/JackServerSettingsDialog.tsx @@ -401,12 +401,22 @@ const JackServerSettingsDialog = withStyles( this.originalJackServerSettings = (settings ?? this.state.jackServerSettings).clone(); } - /** Apply the provided settings to the audio system. */ + /** + * Apply the provided settings to the audio system without persisting + * them. Falls back to the regular setter if the temporary apply API is + * unavailable. + */ applySettings(settings?: JackServerSettings): void { const s = (settings ?? this.state.jackServerSettings).clone(); s.valid = true; - // Fire and forget. Errors will be handled by PiPedalModel's internal error handling. - this.model.setJackServerSettings(s); + + const ws = this.model.webSocket; + if (ws) { + ws.request("applyJackServerSettings", s) + .catch(() => { }); // Fire and forget + } else { + this.model.setJackServerSettings(s); + } } /**