Skip to content

Commit 6857222

Browse files
committed
fix: issues identified by sonar
Signed-off-by: Adam Setch <[email protected]>
1 parent 5429ce4 commit 6857222

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/renderer/components/fields/Checkbox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ export const Checkbox: FC<ICheckbox> = ({
5454
<Tooltip name={`tooltip-${props.name}`} tooltip={props.tooltip} />
5555
)}
5656

57-
{counter && (
57+
{counter ? (
5858
<CounterLabel scheme={props.checked ? 'primary' : 'secondary'}>
5959
{counter}
6060
</CounterLabel>
61-
)}
61+
) : null}
6262
</Stack>
6363
)
6464
);

src/renderer/components/metrics/MetricPill.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ export const MetricPill: FC<IMetricPill> = (props: IMetricPill) => {
2323
>
2424
<Stack direction="horizontal" align="center" gap="none">
2525
<props.icon size={Size.XSMALL} className={props.color} />
26-
{props.metric && <Text className="text-xxs px-1">{props.metric}</Text>}
26+
{props.metric ? (
27+
<Text className="text-xxs px-1">{props.metric}</Text>
28+
) : null}
2729
</Stack>
2830
</Label>
2931
);

src/renderer/utils/auth/utils.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ describe('renderer/utils/auth/utils.ts', () => {
101101
});
102102

103103
await expect(async () => await auth.authGitHub()).rejects.toEqual(
104-
"Oops! Something went wrong and we couldn't log you in using GitHub. Please try again. Reason: The redirect_uri is missing or invalid. Docs: https://docs.github.com/en/developers/apps/troubleshooting-oauth-errors",
104+
new Error(
105+
"Oops! Something went wrong and we couldn't log you in using GitHub. Please try again. Reason: The redirect_uri is missing or invalid. Docs: https://docs.github.com/en/developers/apps/troubleshooting-oauth-errors",
106+
),
105107
);
106108

107109
expect(openExternalLinkMock).toHaveBeenCalledTimes(1);

src/renderer/utils/auth/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ export function authGitHub(
5454
});
5555
} else if (error) {
5656
reject(
57-
`Oops! Something went wrong and we couldn't log you in using GitHub. Please try again. Reason: ${errorDescription} Docs: ${errorUri}`,
57+
new Error(
58+
`Oops! Something went wrong and we couldn't log you in using GitHub. Please try again. Reason: ${errorDescription} Docs: ${errorUri}`,
59+
),
5860
);
5961
}
6062
};

0 commit comments

Comments
 (0)