From b44de10025f689431135e429b95340ded4f13234 Mon Sep 17 00:00:00 2001 From: Alexandr Garbuzov <186095128+alexandr-garbuzov@users.noreply.github.com> Date: Sat, 18 Oct 2025 21:21:41 +0300 Subject: [PATCH] fix: resolve vscode type errors inside color module (#4598) Co-authored-by: Alexandr --- backend/src/common/color.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/src/common/color.js b/backend/src/common/color.js index 759a07ca..a372f244 100644 --- a/backend/src/common/color.js +++ b/backend/src/common/color.js @@ -1,3 +1,5 @@ +// @ts-check + import { themes } from "../../themes/index.js"; /** @@ -69,7 +71,6 @@ const fallbackColor = (color, fallbackColor) => { * @param {string=} args.border_color Card border color. * @param {string=} args.ring_color Card ring color. * @param {string=} args.theme Card theme. - * @param {string=} args.fallbackTheme Fallback theme. * @returns {CardColors} Card colors. */ const getCardColors = ({ @@ -80,11 +81,13 @@ const getCardColors = ({ border_color, ring_color, theme, - fallbackTheme = "default", }) => { - const defaultTheme = themes[fallbackTheme]; + const defaultTheme = themes["default"]; const isThemeProvided = theme !== null && theme !== undefined; + + // @ts-ignore const selectedTheme = isThemeProvided ? themes[theme] : defaultTheme; + const defaultBorderColor = "border_color" in selectedTheme ? selectedTheme.border_color