diff options
author | Shin'ya UEOKA <ueokande@i-beam.org> | 2019-10-07 12:02:02 +0000 |
---|---|---|
committer | Shin'ya UEOKA <ueokande@i-beam.org> | 2019-10-07 12:31:13 +0000 |
commit | 532eeb5a1d9712676a9b3730bb7b27134c57831b (patch) | |
tree | 1cc0360426f383f0cc6a9396d6f591917ed76faf /src/settings | |
parent | 16352502cf9396a9d573c2953940c31f4980c282 (diff) |
Rename valueOf to fromJSON
Diffstat (limited to 'src/settings')
-rw-r--r-- | src/settings/components/form/KeymapsForm.tsx | 2 | ||||
-rw-r--r-- | src/settings/components/form/SearchForm.tsx | 4 | ||||
-rw-r--r-- | src/settings/components/index.tsx | 2 | ||||
-rw-r--r-- | src/settings/storage.ts | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/settings/components/form/KeymapsForm.tsx b/src/settings/components/form/KeymapsForm.tsx index 3cba0c0..94934ae 100644 --- a/src/settings/components/form/KeymapsForm.tsx +++ b/src/settings/components/form/KeymapsForm.tsx @@ -12,7 +12,7 @@ interface Props { class KeymapsForm extends React.Component<Props> { public static defaultProps: Props = { - value: FormKeymaps.valueOf({}), + value: FormKeymaps.fromJSON({}), onChange: () => {}, onBlur: () => {}, }; diff --git a/src/settings/components/form/SearchForm.tsx b/src/settings/components/form/SearchForm.tsx index 6ba6cfb..0aaf6fd 100644 --- a/src/settings/components/form/SearchForm.tsx +++ b/src/settings/components/form/SearchForm.tsx @@ -12,7 +12,7 @@ interface Props { class SearchForm extends React.Component<Props> { public static defaultProps: Props = { - value: FormSearch.valueOf({ default: '', engines: []}), + value: FormSearch.fromJSON({ default: '', engines: []}), onChange: () => {}, onBlur: () => {}, }; @@ -81,7 +81,7 @@ class SearchForm extends React.Component<Props> { } } - this.props.onChange(FormSearch.valueOf(next)); + this.props.onChange(FormSearch.fromJSON(next)); if (name === 'delete' || name === 'default') { this.props.onBlur(); } diff --git a/src/settings/components/index.tsx b/src/settings/components/index.tsx index 586f0f0..160dd9c 100644 --- a/src/settings/components/index.tsx +++ b/src/settings/components/index.tsx @@ -133,7 +133,7 @@ class SettingsComponent extends React.Component<Props> { let data = new SettingData({ source: this.props.source, form: (this.props.form as FormSettings).buildWithSearch( - FormSearch.valueOf(value)), + FormSearch.fromJSON(value)), }); this.props.dispatch(settingActions.set(data)); } diff --git a/src/settings/storage.ts b/src/settings/storage.ts index 32b6351..2a983df 100644 --- a/src/settings/storage.ts +++ b/src/settings/storage.ts @@ -6,7 +6,7 @@ export const load = async(): Promise<SettingData> => { return DefaultSettingData; } try { - return SettingData.valueOf(settings as any); + return SettingData.fromJSON(settings as any); } catch (e) { console.error('unable to load settings', e); return DefaultSettingData; |