From 62f84526355fa92b227c9c896bca4380a067637c Mon Sep 17 00:00:00 2001 From: yofukashino Date: Sat, 31 Aug 2024 14:06:23 +0530 Subject: [PATCH] prettier --- src/renderer/apis/settings.ts | 4 ++-- src/renderer/coremods/commands/commands.ts | 8 ++++---- src/renderer/coremods/settings/pages/Updater.tsx | 5 ++--- src/renderer/util.ts | 13 ++++++------- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/renderer/apis/settings.ts b/src/renderer/apis/settings.ts index 2cdfd9a51..93708dd52 100644 --- a/src/renderer/apis/settings.ts +++ b/src/renderer/apis/settings.ts @@ -57,8 +57,8 @@ export class SettingsManager, D extends ke ): K extends D ? NonNullable : F extends null | undefined - ? T[K] | undefined - : NonNullable | F { + ? T[K] | undefined + : NonNullable | F { if (typeof this.#settings === "undefined") { throw new Error(`Settings not loaded for namespace ${this.namespace}`); } diff --git a/src/renderer/coremods/commands/commands.ts b/src/renderer/coremods/commands/commands.ts index 7377fe0f0..7665c1f12 100644 --- a/src/renderer/coremods/commands/commands.ts +++ b/src/renderer/coremods/commands/commands.ts @@ -351,8 +351,8 @@ export function loadCommands(): void { listType === "enabled" ? enabledString : listType === "disabled" - ? disabledString - : `${enabledString}\n\n${disabledString}`; + ? disabledString + : `${enabledString}\n\n${disabledString}`; return { send, @@ -383,8 +383,8 @@ export function loadCommands(): void { listType === "enabled" ? enabledString : listType === "disabled" - ? disabledString - : `${enabledString}\n\n${disabledString}`; + ? disabledString + : `${enabledString}\n\n${disabledString}`; return { send, diff --git a/src/renderer/coremods/settings/pages/Updater.tsx b/src/renderer/coremods/settings/pages/Updater.tsx index f56d2b97d..9473d39c7 100644 --- a/src/renderer/coremods/settings/pages/Updater.tsx +++ b/src/renderer/coremods/settings/pages/Updater.tsx @@ -22,9 +22,8 @@ const logger = Logger.coremod("Settings:Updater"); export const Updater = (): React.ReactElement => { const [checking, setChecking] = React.useState(false); - const [updatesAvailable, setUpdatesAvailable] = React.useState< - Array - >(getAvailableUpdates()); + const [updatesAvailable, setUpdatesAvailable] = + React.useState>(getAvailableUpdates()); const [updatePromises, setUpdatePromises] = React.useState>>({}); const [didInstallAll, setDidInstallAll] = React.useState(false); const [lastChecked, setLastChecked] = useSettingArray(updaterSettings, "lastChecked"); diff --git a/src/renderer/util.ts b/src/renderer/util.ts index 3ffed1f32..b79a6ccc2 100644 --- a/src/renderer/util.ts +++ b/src/renderer/util.ts @@ -197,8 +197,8 @@ export function useSetting< value: K extends D ? NonNullable : F extends null | undefined - ? T[K] | undefined - : NonNullable | F; + ? T[K] | undefined + : NonNullable | F; onChange: (newValue: ValType) => void; } { const initial = settings.get(key, fallback); @@ -237,8 +237,8 @@ export function useSettingArray< K extends D ? NonNullable : F extends null | undefined - ? T[K] | undefined - : NonNullable | F, + ? T[K] | undefined + : NonNullable | F, (newValue: ValType) => void, ] { const { value, onChange } = useSetting(settings, key, fallback); @@ -256,9 +256,8 @@ type UnionToIntersection = (U extends never ? never : (k: U) => void) extends type ObjectType = Record; -type ExtractObjectType = O extends Array - ? UnionToIntersection - : never; +type ExtractObjectType = + O extends Array ? UnionToIntersection : never; export function virtualMerge(...objects: O): ExtractObjectType { const fallback = {};