Prettier formatting

This commit is contained in:
tyuXX 2026-11-15 20:54:16 +03:00
parent 9f4a3197de
commit 010117bed2
6 changed files with 99 additions and 57 deletions

View file

@ -96,7 +96,10 @@ export const DEFAULT_THEME_CONFIG: ThemeConfig = {
uiEffects: true,
motionEffects: true,
dynamicAccent: true,
gradient: { ...DEFAULT_GRADIENT_CONFIG, stops: [...DEFAULT_GRADIENT_CONFIG.stops] },
gradient: {
...DEFAULT_GRADIENT_CONFIG,
stops: [...DEFAULT_GRADIENT_CONFIG.stops],
},
custom: { ...DEFAULT_CUSTOM_TOKENS },
};
@ -154,7 +157,10 @@ export function normalizeThemeConfig(
? rawGrad.stops
.slice(0, 3)
.map((s, idx) =>
normalizeStoredHex(s, DEFAULT_GRADIENT_CONFIG.stops[idx] ?? "#0f172a"),
normalizeStoredHex(
s,
DEFAULT_GRADIENT_CONFIG.stops[idx] ?? "#0f172a",
),
)
: [...DEFAULT_GRADIENT_CONFIG.stops];
while (rawStops.length < 2) {
@ -185,7 +191,10 @@ export function normalizeThemeConfig(
applyToPanels: rawGrad?.applyToPanels ?? true,
},
custom: {
bgDeep: normalizeStoredHex(rawCustom?.bgDeep, DEFAULT_CUSTOM_TOKENS.bgDeep),
bgDeep: normalizeStoredHex(
rawCustom?.bgDeep,
DEFAULT_CUSTOM_TOKENS.bgDeep,
),
bgPanelSolid: normalizeStoredHex(
rawCustom?.bgPanelSolid,
DEFAULT_CUSTOM_TOKENS.bgPanelSolid,
@ -194,18 +203,27 @@ export function normalizeThemeConfig(
rawCustom?.bgElevated,
DEFAULT_CUSTOM_TOKENS.bgElevated,
),
border: normalizeStoredHex(rawCustom?.border, DEFAULT_CUSTOM_TOKENS.border),
border: normalizeStoredHex(
rawCustom?.border,
DEFAULT_CUSTOM_TOKENS.border,
),
text: normalizeStoredHex(rawCustom?.text, DEFAULT_CUSTOM_TOKENS.text),
textDim: normalizeStoredHex(
rawCustom?.textDim,
DEFAULT_CUSTOM_TOKENS.textDim,
),
accent: normalizeStoredHex(rawCustom?.accent, DEFAULT_CUSTOM_TOKENS.accent),
accent: normalizeStoredHex(
rawCustom?.accent,
DEFAULT_CUSTOM_TOKENS.accent,
),
glow: normalizeStoredHex(rawCustom?.glow, DEFAULT_CUSTOM_TOKENS.glow),
green: normalizeStoredHex(rawCustom?.green, DEFAULT_CUSTOM_TOKENS.green),
amber: normalizeStoredHex(rawCustom?.amber, DEFAULT_CUSTOM_TOKENS.amber),
red: normalizeStoredHex(rawCustom?.red, DEFAULT_CUSTOM_TOKENS.red),
violet: normalizeStoredHex(rawCustom?.violet, DEFAULT_CUSTOM_TOKENS.violet),
violet: normalizeStoredHex(
rawCustom?.violet,
DEFAULT_CUSTOM_TOKENS.violet,
),
panelOpacity: Number.isFinite(opacityNum)
? Math.max(0.65, Math.min(1, opacityNum))
: DEFAULT_CUSTOM_TOKENS.panelOpacity,
@ -245,7 +263,9 @@ export function getSettings(): ClientSettings {
) as LegacyClientSettings;
cachedSettings = {
quality:
raw.quality === "low" || raw.quality === "medium" ? raw.quality : "high",
raw.quality === "low" || raw.quality === "medium"
? raw.quality
: "high",
sound: raw.sound ?? true,
notifications: raw.notifications ?? true,
theme: normalizeThemeConfig(raw.theme, raw),