mirror of
https://github.com/desktop/desktop
synced 2024-09-19 08:02:22 +00:00
Restore theme if cancelled
This commit is contained in:
parent
f1b7e0ba71
commit
19ca8bed5c
|
@ -98,6 +98,8 @@ interface IPreferencesState {
|
|||
*/
|
||||
readonly existingLockFilePath?: string
|
||||
readonly repositoryIndicatorsEnabled: boolean
|
||||
|
||||
readonly initiallySelectedTheme: ApplicationTheme
|
||||
}
|
||||
|
||||
/** The app-level preferences component. */
|
||||
|
@ -132,6 +134,7 @@ export class Preferences extends React.Component<
|
|||
availableShells: [],
|
||||
selectedShell: this.props.selectedShell,
|
||||
repositoryIndicatorsEnabled: this.props.repositoryIndicatorsEnabled,
|
||||
initiallySelectedTheme: this.props.selectedTheme,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -191,12 +194,20 @@ export class Preferences extends React.Component<
|
|||
})
|
||||
}
|
||||
|
||||
private onCancel = () => {
|
||||
if (this.state.initiallySelectedTheme !== this.props.selectedTheme) {
|
||||
this.onSelectedThemeChanged(this.state.initiallySelectedTheme)
|
||||
}
|
||||
|
||||
this.props.onDismissed()
|
||||
}
|
||||
|
||||
public render() {
|
||||
return (
|
||||
<Dialog
|
||||
id="preferences"
|
||||
title={__DARWIN__ ? 'Preferences' : 'Options'}
|
||||
onDismissed={this.props.onDismissed}
|
||||
onDismissed={this.onCancel}
|
||||
onSubmit={this.onSave}
|
||||
>
|
||||
<div className="preferences-container">
|
||||
|
|
Loading…
Reference in a new issue