From 846945b75abada911854b324e5a597e6ed08f329 Mon Sep 17 00:00:00 2001 From: MathieuG-P <40181755+Zagrios@users.noreply.github.com> Date: Sun, 1 Sep 2024 22:55:21 +0200 Subject: [PATCH] [feature] fix sonarlint issues --- src/main/services/installation-location.service.ts | 2 +- .../settings/setting-toogle-switch-grid.component.tsx | 4 ++-- src/renderer/components/shared/toogle-switch.component.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/services/installation-location.service.ts b/src/main/services/installation-location.service.ts index 58ef547e..f1c012f1 100644 --- a/src/main/services/installation-location.service.ts +++ b/src/main/services/installation-location.service.ts @@ -67,7 +67,7 @@ export class InstallationLocationService { } if(this.staticConfig.has(this.STORE_INSTALLATION_PATH_KEY)) { - return this.staticConfig.get(this.STORE_INSTALLATION_PATH_KEY) as string; + return this.staticConfig.get(this.STORE_INSTALLATION_PATH_KEY); } const { result: oldPath } = tryit(() => path.join(app.getPath("documents"), this.INSTALLATION_FOLDER)); diff --git a/src/renderer/components/settings/setting-toogle-switch-grid.component.tsx b/src/renderer/components/settings/setting-toogle-switch-grid.component.tsx index f74dd4a6..cba43faf 100644 --- a/src/renderer/components/settings/setting-toogle-switch-grid.component.tsx +++ b/src/renderer/components/settings/setting-toogle-switch-grid.component.tsx @@ -4,14 +4,14 @@ type Item = { text: string; desc?: string; checked?: boolean; - onChange?: (isChecked: boolean) => void; + onChange?: (isChecked: boolean) => void|Promise; }; type Props = { items: Item[]; }; -export function SettingToogleSwitchGrid({ items }: Props) { +export function SettingToogleSwitchGrid({ items }: Readonly) { const handleItemChange = (item: Item, state: boolean) => { item.onChange?.(state); diff --git a/src/renderer/components/shared/toogle-switch.component.tsx b/src/renderer/components/shared/toogle-switch.component.tsx index 50ca287a..52c460cc 100644 --- a/src/renderer/components/shared/toogle-switch.component.tsx +++ b/src/renderer/components/shared/toogle-switch.component.tsx @@ -17,7 +17,7 @@ type Props = { onChange?: (isChecked: boolean) => void; } -export function ToogleSwitch({ checked, className, classNames, bgColor, onChange }: Props) { +export function ToogleSwitch({ checked, className, classNames, bgColor, onChange }: Readonly) { const uuid = useConstant(() => crypto.randomUUID()); const { firstColor } = useThemeColor();