Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
yofukashino committed Aug 31, 2024
1 parent f441acf commit 62f8452
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/renderer/apis/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export class SettingsManager<T extends Record<string, Jsonifiable>, D extends ke
): K extends D
? NonNullable<T[K]>
: F extends null | undefined
? T[K] | undefined
: NonNullable<T[K]> | F {
? T[K] | undefined
: NonNullable<T[K]> | F {
if (typeof this.#settings === "undefined") {
throw new Error(`Settings not loaded for namespace ${this.namespace}`);
}
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/coremods/commands/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 2 additions & 3 deletions src/renderer/coremods/settings/pages/Updater.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<UpdateSettings & { id: string }>
>(getAvailableUpdates());
const [updatesAvailable, setUpdatesAvailable] =
React.useState<Array<UpdateSettings & { id: string }>>(getAvailableUpdates());
const [updatePromises, setUpdatePromises] = React.useState<Record<string, Promise<boolean>>>({});
const [didInstallAll, setDidInstallAll] = React.useState(false);
const [lastChecked, setLastChecked] = useSettingArray(updaterSettings, "lastChecked");
Expand Down
13 changes: 6 additions & 7 deletions src/renderer/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ export function useSetting<
value: K extends D
? NonNullable<T[K]>
: F extends null | undefined
? T[K] | undefined
: NonNullable<T[K]> | F;
? T[K] | undefined
: NonNullable<T[K]> | F;
onChange: (newValue: ValType<T[K]>) => void;
} {
const initial = settings.get(key, fallback);
Expand Down Expand Up @@ -237,8 +237,8 @@ export function useSettingArray<
K extends D
? NonNullable<T[K]>
: F extends null | undefined
? T[K] | undefined
: NonNullable<T[K]> | F,
? T[K] | undefined
: NonNullable<T[K]> | F,
(newValue: ValType<T[K]>) => void,
] {
const { value, onChange } = useSetting(settings, key, fallback);
Expand All @@ -256,9 +256,8 @@ type UnionToIntersection<U> = (U extends never ? never : (k: U) => void) extends

type ObjectType = Record<never, never>;

type ExtractObjectType<O extends ObjectType[]> = O extends Array<infer T>
? UnionToIntersection<T>
: never;
type ExtractObjectType<O extends ObjectType[]> =
O extends Array<infer T> ? UnionToIntersection<T> : never;

export function virtualMerge<O extends ObjectType[]>(...objects: O): ExtractObjectType<O> {
const fallback = {};
Expand Down

0 comments on commit 62f8452

Please sign in to comment.