From c9e5e97b00356586e3d6c69844ac2c3ee3515bd0 Mon Sep 17 00:00:00 2001 From: Extremesecrecy <10959169+extremesecrecy@users.noreply.github.com> Date: Sat, 26 Jul 2025 10:01:24 -0700 Subject: [PATCH] persistence again Clean start worked but now the persisted is not working. Patching persistence. --- vite/src/pipedal/JackServerSettingsDialog.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vite/src/pipedal/JackServerSettingsDialog.tsx b/vite/src/pipedal/JackServerSettingsDialog.tsx index 8d4f106..7feefc7 100644 --- a/vite/src/pipedal/JackServerSettingsDialog.tsx +++ b/vite/src/pipedal/JackServerSettingsDialog.tsx @@ -472,7 +472,11 @@ const JackServerSettingsDialog = withStyles( componentWillUnmount() { super.componentWillUnmount(); this.mounted = false; - this.stopStatusTimer(); + this.stopStatusTimer(); + if (this.originalJackServerSettings) { + this.model.setJackServerSettings(this.originalJackServerSettings); + this.originalJackServerSettings = undefined; + } } getSelectedDevice(deviceId: string): AlsaDeviceInfo | undefined { @@ -558,6 +562,9 @@ const JackServerSettingsDialog = withStyles( let s = this.state.jackServerSettings.clone(); s.valid = true; this.props.onApply(s); + // Prevent componentWillUnmount from reverting after the + // settings have been saved. + this.originalJackServerSettings = undefined; }; handleWarningProceed() { @@ -612,6 +619,7 @@ const JackServerSettingsDialog = withStyles( const handleClose = () => { if (this.originalJackServerSettings) { this.model.setJackServerSettings(this.originalJackServerSettings); + this.originalJackServerSettings = undefined; } onClose(); };