Disable settings "Apply" button when no changes have been made

Summary: It's a bit nicer to be able to see if there are any changes made, and save restarting flipper when nothing has changed.

Reviewed By: passy

Differential Revision: D17738036

fbshipit-source-id: 3d7cdc5be1bf948094c3df54439625e5052a9a2f
This commit is contained in:
John Knox
2019-10-07 08:49:05 -07:00
committed by Facebook Github Bot
parent 8e5b69164a
commit 44ab23557e
3 changed files with 21 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ import {flush} from '../utils/persistor';
import {promises as fs} from 'fs';
import {remote} from 'electron';
import path from 'path';
import isEqual from 'lodash.isequal';
const Container = styled(FlexColumn)({
padding: 20,
@@ -158,7 +159,12 @@ class SignInSheet extends Component<Props, State> {
<Button compact padded onClick={this.props.onHide}>
Cancel
</Button>
<Button type="primary" compact padded onClick={this.applyChanges}>
<Button
disabled={isEqual(this.props.settings, this.state.updatedSettings)}
type="primary"
compact
padded
onClick={this.applyChanges}>
Apply and Restart
</Button>
</FlexRow>