aboutsummaryrefslogtreecommitdiff
path: root/src/settings/components/form/SearchForm.tsx
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-12-22 10:01:24 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2019-12-22 10:48:39 +0900
commit2e7006ce24c42ec2b6642346d153429338e7334e (patch)
treef1eb9e843ab4ec5d7d3f08fff8c858174b6f1284 /src/settings/components/form/SearchForm.tsx
parent0881f92d20cb7b4f5a75671df739c3eaa3cd0ff0 (diff)
npm run lint:fix
Diffstat (limited to 'src/settings/components/form/SearchForm.tsx')
-rw-r--r--src/settings/components/form/SearchForm.tsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/settings/components/form/SearchForm.tsx b/src/settings/components/form/SearchForm.tsx
index 0aaf6fd..5dc786b 100644
--- a/src/settings/components/form/SearchForm.tsx
+++ b/src/settings/components/form/SearchForm.tsx
@@ -18,7 +18,7 @@ class SearchForm extends React.Component<Props> {
};
render() {
- let value = this.props.value.toJSON();
+ const value = this.props.value.toJSON();
return <div className='form-search-form'>
<div className='form-search-form-header'>
<div className='column-name'>Name</div>
@@ -56,10 +56,10 @@ class SearchForm extends React.Component<Props> {
// eslint-disable-next-line max-statements
bindValue(e: any) {
- let value = this.props.value.toJSON();
- let name = e.target.name;
- let index = Number(e.target.getAttribute('data-index'));
- let next: typeof value = {
+ const value = this.props.value.toJSON();
+ const name = e.target.name;
+ const index = Number(e.target.getAttribute('data-index'));
+ const next: typeof value = {
default: value.default,
engines: value.engines.slice(),
};
@@ -76,7 +76,7 @@ class SearchForm extends React.Component<Props> {
} else if (name === 'delete' && value.engines.length > 1) {
next.engines.splice(index, 1);
if (value.engines[index][0] === value.default) {
- let nextIndex = Math.min(index, next.engines.length - 1);
+ const nextIndex = Math.min(index, next.engines.length - 1);
next.default = next.engines[nextIndex][0];
}
}