aboutsummaryrefslogtreecommitdiff
path: root/src/settings/components
diff options
context:
space:
mode:
authorShin'ya UEOKA <ueokande@i-beam.org>2019-10-04 04:01:35 +0000
committerShin'ya UEOKA <ueokande@i-beam.org>2019-10-06 12:58:59 +0000
commit410ffbb0376b9399928ef8d4dd13079bfb120e14 (patch)
treee408870fb867c7affb04c9b0130463df24e9f097 /src/settings/components
parentb496cea5827165bd23a503231f94f708a976cad4 (diff)
Make Keymap class
Diffstat (limited to 'src/settings/components')
-rw-r--r--src/settings/components/index.tsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/settings/components/index.tsx b/src/settings/components/index.tsx
index eeac2cf..ada6efb 100644
--- a/src/settings/components/index.tsx
+++ b/src/settings/components/index.tsx
@@ -8,7 +8,7 @@ import BlacklistForm from './form/BlacklistForm';
import PropertiesForm from './form/PropertiesForm';
import * as settingActions from '../../settings/actions/setting';
import SettingData, {
- JSONSettings, FormKeymaps, FormSearch, FormSettings,
+ JSONTextSettings, FormKeymaps, FormSearch, FormSettings,
} from '../../shared/SettingData';
import { State as AppState } from '../reducers/setting';
import * as settings from '../../shared/Settings';
@@ -75,7 +75,7 @@ class SettingsComponent extends React.Component<Props> {
</div>;
}
- renderJsonFields(json: JSONSettings, error: string) {
+ renderJsonFields(json: JSONTextSettings, error: string) {
return <div>
<Input
type='textarea'
@@ -85,7 +85,7 @@ class SettingsComponent extends React.Component<Props> {
error={error}
onValueChange={this.bindJson.bind(this)}
onBlur={this.save.bind(this)}
- value={json.toJSON()}
+ value={json.toJSONText()}
/>
</div>;
}
@@ -97,7 +97,7 @@ class SettingsComponent extends React.Component<Props> {
fields = this.renderFormFields(this.props.form);
} else if (this.props.source === 'json') {
fields = this.renderJsonFields(
- this.props.json as JSONSettings, this.props.error);
+ this.props.json as JSONTextSettings, this.props.error);
}
return (
<div>
@@ -165,7 +165,7 @@ class SettingsComponent extends React.Component<Props> {
bindJson(_name: string, value: string) {
let data = new SettingData({
source: this.props.source,
- json: JSONSettings.valueOf(value),
+ json: JSONTextSettings.fromText(value),
});
this.props.dispatch(settingActions.set(data));
}
@@ -183,7 +183,7 @@ class SettingsComponent extends React.Component<Props> {
return;
}
this.props.dispatch(
- settingActions.switchToForm(this.props.json as JSONSettings));
+ settingActions.switchToForm(this.props.json as JSONTextSettings));
this.save();
}
}