aboutsummaryrefslogtreecommitdiff
path: root/src/settings/components
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-06-28 20:44:57 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2018-06-28 20:44:57 +0900
commite2fb33bdc513385e9d71bc5b3d5068f7db9713d7 (patch)
tree28d544a6fd2237f5d0ed7809d45d783c18b9261f /src/settings/components
parent03cf265eff0f4866959369531c2a1f5a5a0684b7 (diff)
fix but failed
Diffstat (limited to 'src/settings/components')
-rw-r--r--src/settings/components/form/keymaps-form.jsx2
-rw-r--r--src/settings/components/form/properties-form.jsx2
-rw-r--r--src/settings/components/form/search-form.jsx4
-rw-r--r--src/settings/components/index.jsx16
4 files changed, 11 insertions, 13 deletions
diff --git a/src/settings/components/form/keymaps-form.jsx b/src/settings/components/form/keymaps-form.jsx
index f0f69cf..dcf65d9 100644
--- a/src/settings/components/form/keymaps-form.jsx
+++ b/src/settings/components/form/keymaps-form.jsx
@@ -100,7 +100,7 @@ class KeymapsForm extends Component {
return;
}
- let next = Object.assign({}, this.props.value);
+ let next = { ...this.props.value };
next[e.target.name] = e.target.value;
this.props.onChange(next);
diff --git a/src/settings/components/form/properties-form.jsx b/src/settings/components/form/properties-form.jsx
index 55c8512..ceb79d7 100644
--- a/src/settings/components/form/properties-form.jsx
+++ b/src/settings/components/form/properties-form.jsx
@@ -44,7 +44,7 @@ class PropertiesForm extends Component {
}
let name = e.target.name;
- let next = Object.assign({}, this.props.value);
+ let next = { ...this.props.value };
if (e.target.type.toLowerCase() === 'checkbox') {
next[name] = e.target.checked;
} else if (e.target.type.toLowerCase() === 'number') {
diff --git a/src/settings/components/form/search-form.jsx b/src/settings/components/form/search-form.jsx
index e85761f..2d5f01b 100644
--- a/src/settings/components/form/search-form.jsx
+++ b/src/settings/components/form/search-form.jsx
@@ -53,10 +53,10 @@ class SearchForm extends Component {
let value = this.props.value;
let name = e.target.name;
let index = e.target.getAttribute('data-index');
- let next = Object.assign({}, {
+ let next = {
default: value.default,
engines: value.engines ? value.engines.slice() : [],
- });
+ };
if (name === 'name') {
next.engines[index][0] = e.target.value;
diff --git a/src/settings/components/index.jsx b/src/settings/components/index.jsx
index e13bfa1..c479986 100644
--- a/src/settings/components/index.jsx
+++ b/src/settings/components/index.jsx
@@ -134,7 +134,7 @@ class SettingsComponent extends Component {
}
validateValue(e) {
- let next = Object.assign({}, this.state);
+ let next = { ...this.state };
next.errors.json = '';
try {
@@ -146,18 +146,16 @@ class SettingsComponent extends Component {
}
bindForm(name, value) {
- let next = Object.assign({}, this.state, {
- settings: Object.assign({}, this.state.settings, {
- form: Object.assign({}, this.state.settings.form)
- })
- });
+ let next = { ...this.state,
+ settings: { ...this.state.settings,
+ form: { ...this.state.settings.form }}};
next.settings.form[name] = value;
this.setState(next);
this.context.store.dispatch(settingActions.save(next.settings));
}
bindValue(e) {
- let next = Object.assign({}, this.state);
+ let next = { ...this.state };
let error = false;
next.errors.json = '';
@@ -190,7 +188,7 @@ class SettingsComponent extends Component {
let form = settingsValues.formFromJson(
this.state.settings.json, KeymapsForm.AllowdOps);
- let next = Object.assign({}, this.state);
+ let next = { ...this.state };
next.settings.form = form;
next.settings.source = 'form';
next.errors.json = '';
@@ -201,7 +199,7 @@ class SettingsComponent extends Component {
migrateToJson() {
let json = settingsValues.jsonFromForm(this.state.settings.form);
- let next = Object.assign({}, this.state);
+ let next = { ...this.state };
next.settings.json = json;
next.settings.source = 'json';
next.errors.json = '';