Update JackServerSettingsDialog.tsx

Added an explicit reset for the dialog’s close guard when the dialog mounts or reopens, preventing saved settings from reverting after pressing OK

Modified the close handler to skip reverting settings whenever the dialog was closed via the OK path
This commit is contained in:
Extremesecrecy
2025-07-27 13:05:18 -07:00
parent 13a8b47658
commit c82c465620
@@ -491,6 +491,7 @@ const JackServerSettingsDialog = withStyles(
componentDidMount() {
super.componentDidMount();
this.mounted = true;
this.ignoreClose = false;
if (this.props.open) {
this.requestAlsaInfo();
this.startStatusTimer();
@@ -499,6 +500,7 @@ const JackServerSettingsDialog = withStyles(
}
componentDidUpdate(oldProps: JackServerSettingsDialogProps) {
if ((this.props.open && !oldProps.open) && this.mounted) {
this.ignoreClose = false;
this.saveSettingsTemporary(this.props.jackServerSettings);
// When opening, preserve the current settings until ALSA device
// information is loaded. If we don't have device info yet, just
@@ -683,7 +685,6 @@ const JackServerSettingsDialog = withStyles(
//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();