diff options
author | Vijay A <vraravam@users.noreply.github.com> | 2023-05-28 13:48:21 +0530 |
---|---|---|
committer | Vijay A <vraravam@users.noreply.github.com> | 2023-05-28 13:48:21 +0530 |
commit | 99ca310c73024b51fed1f3077375eed7827f2c20 (patch) | |
tree | 2bd15986f448129a2291acba90ccc6bf68a233e0 /src/components/ui/Select.tsx | |
parent | Disable in-app auto-updates for portable windows installation (fixes #1088) (... (diff) | |
download | ferdium-app-99ca310c73024b51fed1f3077375eed7827f2c20.tar.gz ferdium-app-99ca310c73024b51fed1f3077375eed7827f2c20.tar.zst ferdium-app-99ca310c73024b51fed1f3077375eed7827f2c20.zip |
Fix issues reported by sonarqube linter
Diffstat (limited to 'src/components/ui/Select.tsx')
-rw-r--r-- | src/components/ui/Select.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/components/ui/Select.tsx b/src/components/ui/Select.tsx index e8e305fdd..8ae2945ce 100644 --- a/src/components/ui/Select.tsx +++ b/src/components/ui/Select.tsx | |||
@@ -18,7 +18,7 @@ interface IProps { | |||
18 | multiple?: boolean; | 18 | multiple?: boolean; |
19 | } | 19 | } |
20 | 20 | ||
21 | // Can this file be merged into the './select/index.tsx' file? | 21 | // TODO: Can this file be merged into the './select/index.tsx' file? |
22 | @observer | 22 | @observer |
23 | class Select extends Component<IProps> { | 23 | class Select extends Component<IProps> { |
24 | private element: RefObject<HTMLSelectElement> = | 24 | private element: RefObject<HTMLSelectElement> = |
@@ -57,7 +57,7 @@ class Select extends Component<IProps> { | |||
57 | let selected = field.value; | 57 | let selected = field.value; |
58 | 58 | ||
59 | if (multiple) { | 59 | if (multiple) { |
60 | if (typeof field.value === 'string' && field.value.slice(0, 1) === '[') { | 60 | if (typeof field.value === 'string' && field.value.startsWith('[')) { |
61 | // Value is JSON encoded | 61 | // Value is JSON encoded |
62 | selected = JSON.parse(field.value); | 62 | selected = JSON.parse(field.value); |
63 | } else if (typeof field.value === 'object') { | 63 | } else if (typeof field.value === 'object') { |