diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-11-26 16:41:59 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-11-26 16:41:59 +0900 |
commit | c23333110d846b4bf4a76422853820875b74e93a (patch) | |
tree | 64555dd19f414d27308ec3cd43ed6bdfef7d077b /src/settings/components | |
parent | 26777d9e309dbc328b59581adb92f160c18f812c (diff) |
confirm before setting migration
Diffstat (limited to 'src/settings/components')
-rw-r--r-- | src/settings/components/index.jsx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/settings/components/index.jsx b/src/settings/components/index.jsx index b7de259..3961982 100644 --- a/src/settings/components/index.jsx +++ b/src/settings/components/index.jsx @@ -8,6 +8,10 @@ import * as settingActions from 'settings/actions/setting'; import * as validator from 'shared/validators/setting'; import * as settingsValues from 'shared/settings/values'; +const DO_YOU_WANT_TO_CONTINUE = + 'Some settings in JSON can be lose on migrating. ' + + 'Do you want to continue ?'; + class SettingsComponent extends Component { constructor(props, context) { super(props, context); @@ -154,6 +158,11 @@ class SettingsComponent extends Component { next.settings.json = settingsValues.jsonFromForm(this.state.settings.form); } else if (from === 'json' && to === 'form') { + let b = window.confirm(DO_YOU_WANT_TO_CONTINUE); + if (!b) { + this.setState(this.state); + return; + } next.settings.form = settingsValues.formFromJson(this.state.settings.json); } |