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:
committed by
Facebook Github Bot
parent
8e5b69164a
commit
44ab23557e
@@ -58,6 +58,7 @@
|
|||||||
"@types/invariant": "^2.2.30",
|
"@types/invariant": "^2.2.30",
|
||||||
"@types/jest": "^24.0.16",
|
"@types/jest": "^24.0.16",
|
||||||
"@types/lodash.debounce": "^4.0.6",
|
"@types/lodash.debounce": "^4.0.6",
|
||||||
|
"@types/lodash.isequal": "^4.5.5",
|
||||||
"@types/react": "^16.8.24",
|
"@types/react": "^16.8.24",
|
||||||
"@types/react-dom": "^16.8.5",
|
"@types/react-dom": "^16.8.5",
|
||||||
"@types/react-redux": "^7.1.1",
|
"@types/react-redux": "^7.1.1",
|
||||||
@@ -123,6 +124,7 @@
|
|||||||
"line-replace": "^1.0.2",
|
"line-replace": "^1.0.2",
|
||||||
"live-plugin-manager": "^0.13.2",
|
"live-plugin-manager": "^0.13.2",
|
||||||
"lodash.debounce": "^4.0.8",
|
"lodash.debounce": "^4.0.8",
|
||||||
|
"lodash.isequal": "^4.5.0",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"node-fetch": "^2.3.0",
|
"node-fetch": "^2.3.0",
|
||||||
"open": "^6.4.0",
|
"open": "^6.4.0",
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import {flush} from '../utils/persistor';
|
|||||||
import {promises as fs} from 'fs';
|
import {promises as fs} from 'fs';
|
||||||
import {remote} from 'electron';
|
import {remote} from 'electron';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
import isEqual from 'lodash.isequal';
|
||||||
|
|
||||||
const Container = styled(FlexColumn)({
|
const Container = styled(FlexColumn)({
|
||||||
padding: 20,
|
padding: 20,
|
||||||
@@ -158,7 +159,12 @@ class SignInSheet extends Component<Props, State> {
|
|||||||
<Button compact padded onClick={this.props.onHide}>
|
<Button compact padded onClick={this.props.onHide}>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</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
|
Apply and Restart
|
||||||
</Button>
|
</Button>
|
||||||
</FlexRow>
|
</FlexRow>
|
||||||
|
|||||||
12
yarn.lock
12
yarn.lock
@@ -1172,6 +1172,13 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@types/lodash" "*"
|
"@types/lodash" "*"
|
||||||
|
|
||||||
|
"@types/lodash.isequal@^4.5.5":
|
||||||
|
version "4.5.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/lodash.isequal/-/lodash.isequal-4.5.5.tgz#4fed1b1b00bef79e305de0352d797e9bb816c8ff"
|
||||||
|
integrity sha512-4IKbinG7MGP131wRfceK6W4E/Qt3qssEFLF30LnJbjYiSfHGGRU/Io8YxXrZX109ir+iDETC8hw8QsDijukUVg==
|
||||||
|
dependencies:
|
||||||
|
"@types/lodash" "*"
|
||||||
|
|
||||||
"@types/lodash@*":
|
"@types/lodash@*":
|
||||||
version "4.14.136"
|
version "4.14.136"
|
||||||
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.136.tgz#413e85089046b865d960c9ff1d400e04c31ab60f"
|
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.136.tgz#413e85089046b865d960c9ff1d400e04c31ab60f"
|
||||||
@@ -5942,6 +5949,11 @@ lodash.debounce@^4.0.8:
|
|||||||
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
|
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
|
||||||
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=
|
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=
|
||||||
|
|
||||||
|
lodash.isequal@^4.5.0:
|
||||||
|
version "4.5.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
|
||||||
|
integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA=
|
||||||
|
|
||||||
lodash.isplainobject@^4.0.6:
|
lodash.isplainobject@^4.0.6:
|
||||||
version "4.0.6"
|
version "4.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb"
|
resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb"
|
||||||
|
|||||||
Reference in New Issue
Block a user