Warning Fix, added comments 2
Warning handler was causing the ok not to function correctly.
This commit is contained in:
@@ -322,6 +322,9 @@ const JackServerSettingsDialog = withStyles(
|
|||||||
statusTimer?: number = undefined;
|
statusTimer?: number = undefined;
|
||||||
|
|
||||||
suppressDeviceWarning: boolean;
|
suppressDeviceWarning: boolean;
|
||||||
|
/**
|
||||||
|
* Copy of the settings when the dialog is opened. Pressing Apply only tests these settings temporarily. Closing the dialog without OK re-applies the saved copy so the audio driver returns to its previous configuration.
|
||||||
|
*/
|
||||||
originalJackServerSettings?: JackServerSettings;
|
originalJackServerSettings?: JackServerSettings;
|
||||||
|
|
||||||
getFullScreen() {
|
getFullScreen() {
|
||||||
@@ -473,6 +476,12 @@ const JackServerSettingsDialog = withStyles(
|
|||||||
super.componentWillUnmount();
|
super.componentWillUnmount();
|
||||||
this.mounted = false;
|
this.mounted = false;
|
||||||
this.stopStatusTimer();
|
this.stopStatusTimer();
|
||||||
|
if (this.originalJackServerSettings) {
|
||||||
|
// Revert any unapplied changes when the dialog is unmounted
|
||||||
|
this.model.applyJackServerSettings(this.originalJackServerSettings);
|
||||||
|
this.model.setJackServerSettings(this.originalJackServerSettings);
|
||||||
|
this.originalJackServerSettings = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -582,7 +591,14 @@ const JackServerSettingsDialog = withStyles(
|
|||||||
this.setState({ showDeviceWarning: false, dontShowWarningAgain: false }, () => {
|
this.setState({ showDeviceWarning: false, dontShowWarningAgain: false }, () => {
|
||||||
let s = this.state.jackServerSettings.clone();
|
let s = this.state.jackServerSettings.clone();
|
||||||
s.valid = true;
|
s.valid = true;
|
||||||
|
// Accept the new settings so the dialog won't revert them on close
|
||||||
|
this.originalJackServerSettings = undefined;
|
||||||
|
// Apply and persist the settings just like the OK handler
|
||||||
|
this.model.applyJackServerSettings(s);
|
||||||
|
this.model.setJackServerSettings(s);
|
||||||
|
if (this.props.onApply) {
|
||||||
this.props.onApply(s);
|
this.props.onApply(s);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
handleWarningCancel() {
|
handleWarningCancel() {
|
||||||
|
|||||||
Reference in New Issue
Block a user