From 13a8b476586f56c4efaad043fc3070e5c8c246ce Mon Sep 17 00:00:00 2001 From: Extremesecrecy <10959169+extremesecrecy@users.noreply.github.com> Date: Sun, 27 Jul 2025 12:48:57 -0700 Subject: [PATCH] Update JackServerSettingsDialog.tsx On close modified to have an ignore. --- vite/src/pipedal/JackServerSettingsDialog.tsx | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/vite/src/pipedal/JackServerSettingsDialog.tsx b/vite/src/pipedal/JackServerSettingsDialog.tsx index 8c678f0..9a09a99 100644 --- a/vite/src/pipedal/JackServerSettingsDialog.tsx +++ b/vite/src/pipedal/JackServerSettingsDialog.tsx @@ -299,6 +299,7 @@ const JackServerSettingsDialog = withStyles( class extends ResizeResponsiveComponent { model: PiPedalModel; + ignoreClose: boolean = false; constructor(props: JackServerSettingsDialogProps) { super(props); @@ -385,7 +386,6 @@ const JackServerSettingsDialog = withStyles( } } - // ---------------------- New API helpers ---------------------- /** Persist the current settings to permanent storage. */ saveSettings(settings?: JackServerSettings) { const s = (settings ?? this.state.jackServerSettings).clone(); @@ -615,6 +615,7 @@ const JackServerSettingsDialog = withStyles( return; } // apply and persist the selected settings + this.ignoreClose = true; this.releaseDevices(); this.applySettings(); this.saveSettings(); @@ -630,6 +631,7 @@ const JackServerSettingsDialog = withStyles( this.suppressDeviceWarning = true; } this.setState({ showDeviceWarning: false, dontShowWarningAgain: false }, () => { + this.ignoreClose = true; this.releaseDevices(); this.applySettings(); this.saveSettings(); @@ -678,13 +680,19 @@ const JackServerSettingsDialog = withStyles( const { onClose, open } = this.props; + //Ignore close rutine if the ignoreclose is true. (After OK or Proceed or Multi Device Warning) const handleClose = () => { + if (this.ignoreClose) { + this.ignoreClose = false; + return; + } else { this.releaseDevices(); - if (this.originalJackServerSettings) { - // Revert any applied settings - this.applySettings(this.originalJackServerSettings); - this.saveSettings(this.originalJackServerSettings); - this.originalJackServerSettings = undefined; + if (this.originalJackServerSettings) { + // Revert any applied settings + this.applySettings(this.originalJackServerSettings); + this.saveSettings(this.originalJackServerSettings); + this.originalJackServerSettings = undefined; + } } onClose(); };