Skip to content

Commit

Permalink
cspell
Browse files Browse the repository at this point in the history
  • Loading branch information
yofukashino committed Aug 31, 2024
1 parent 7979ec3 commit f441acf
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"signingkey",
"Skema",
"skus",
"titlebar",
"uninject",
"uninjector",
"uninjectors",
Expand Down
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
2 changes: 1 addition & 1 deletion src/renderer/coremods/settings/pages/General.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const General = (): React.ReactElement => {
titlebarOnChange(value);
restartModal(false);
}}
note={"Use custom window titlebars instead of the default OS titlebars"}>
note={"Use custom window titlebar instead of the default OS titlebar"}>
Custom Titlebar
</SwitchItem>
)
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/coremods/settings/pages/Updater.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ 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: 7 additions & 6 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,8 +256,9 @@ 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 f441acf

Please sign in to comment.