From bce2e68ee37f840b61b367f582411a47d4856e11 Mon Sep 17 00:00:00 2001 From: Extremesecrecy <10959169+extremesecrecy@users.noreply.github.com> Date: Fri, 25 Jul 2025 18:42:50 -0700 Subject: [PATCH] Update JackServerSettingsDialog.tsx Apply button does not save settings, it is only used for testing. As per Robin on git. Ok button will save settings only. If the box is closed/cancelled, the settings revert to what they were before. --- vite/src/pipedal/JackServerSettingsDialog.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vite/src/pipedal/JackServerSettingsDialog.tsx b/vite/src/pipedal/JackServerSettingsDialog.tsx index f2d0b5d..db75c81 100644 --- a/vite/src/pipedal/JackServerSettingsDialog.tsx +++ b/vite/src/pipedal/JackServerSettingsDialog.tsx @@ -322,6 +322,7 @@ const JackServerSettingsDialog = withStyles( statusTimer?: number = undefined; suppressDeviceWarning: boolean; + originalJackServerSettings?: JackServerSettings; getFullScreen() { return document.documentElement.clientWidth < 420 || @@ -445,6 +446,7 @@ const JackServerSettingsDialog = withStyles( } componentDidUpdate(oldProps: JackServerSettingsDialogProps) { if ((this.props.open && !oldProps.open) && this.mounted) { + this.originalJackServerSettings = this.props.jackServerSettings.clone(); // 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. @@ -463,6 +465,7 @@ const JackServerSettingsDialog = withStyles( this.startStatusTimer(); } else if (!this.props.open && oldProps.open) { this.stopStatusTimer(); + this.originalJackServerSettings = undefined; } } @@ -607,6 +610,9 @@ const JackServerSettingsDialog = withStyles( const { onClose, open } = this.props; const handleClose = () => { + if (this.originalJackServerSettings) { + this.model.setJackServerSettings(this.originalJackServerSettings); + } onClose(); };