From 99ca310c73024b51fed1f3077375eed7827f2c20 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sun, 28 May 2023 13:48:21 +0530 Subject: Fix issues reported by sonarqube linter --- src/components/ui/Select.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/components/ui/Select.tsx') 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 { multiple?: boolean; } -// Can this file be merged into the './select/index.tsx' file? +// TODO: Can this file be merged into the './select/index.tsx' file? @observer class Select extends Component { private element: RefObject = @@ -57,7 +57,7 @@ class Select extends Component { let selected = field.value; if (multiple) { - if (typeof field.value === 'string' && field.value.slice(0, 1) === '[') { + if (typeof field.value === 'string' && field.value.startsWith('[')) { // Value is JSON encoded selected = JSON.parse(field.value); } else if (typeof field.value === 'object') { -- cgit v1.2.3-70-g09d2