Skip to content

Commit

Permalink
Fix: remove usused variable, apply optional chaining #24
Browse files Browse the repository at this point in the history
  • Loading branch information
luckylooky2 committed Jun 11, 2024
1 parent 963c31e commit b8bd513
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions public/app/features/dashboard/containers/OptionDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface Props {
showOptions: () => void;
}

const OptionDropdown = ({ variable, picker, toggleOption, showOptions, hideOptions }: Props) => {
const OptionDropdown = ({ variable, picker, toggleOption, showOptions }: Props) => {
const [isOpen, setIsOpen] = useState(false);
const gitHubButtonStyles = useStyles2(GitHubButtonStyles);
const styles = useStyles2(getStyles);
Expand Down Expand Up @@ -82,7 +82,7 @@ const OptionDropdown = ({ variable, picker, toggleOption, showOptions, hideOptio
isChecked={
isMulti
? isChecked(picker.selectedValues, createAction.text)
: createAction.text === variable.options.filter((v) => v.selected === true)[0].text
: createAction.text === variable.options.filter((v) => v.selected === true)[0]?.text
}
onClick={isMulti ? handleToggle(createAction.option) : handleNavigate(createAction)}
/>
Expand All @@ -104,7 +104,7 @@ const OptionDropdown = ({ variable, picker, toggleOption, showOptions, hideOptio
</div>
<div className={css(styles.text, mqstyles.hideBelowMedium)}>
{isMulti && variable.id}
{!isMulti && variable.options.filter((v) => v.selected === true)[0].value}
{!isMulti && variable.options.filter((v) => v.selected === true)[0]?.value}
</div>
</div>
</ToolbarButton>
Expand Down

0 comments on commit b8bd513

Please sign in to comment.