Skip to content

Commit b44de10

Browse files
alexandr-garbuzovqwerty541
authored andcommitted
fix: resolve vscode type errors inside color module (anuraghazra#4598)
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
1 parent ad5579f commit b44de10

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

backend/src/common/color.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// @ts-check
2+
13
import { themes } from "../../themes/index.js";
24

35
/**
@@ -69,7 +71,6 @@ const fallbackColor = (color, fallbackColor) => {
6971
* @param {string=} args.border_color Card border color.
7072
* @param {string=} args.ring_color Card ring color.
7173
* @param {string=} args.theme Card theme.
72-
* @param {string=} args.fallbackTheme Fallback theme.
7374
* @returns {CardColors} Card colors.
7475
*/
7576
const getCardColors = ({
@@ -80,11 +81,13 @@ const getCardColors = ({
8081
border_color,
8182
ring_color,
8283
theme,
83-
fallbackTheme = "default",
8484
}) => {
85-
const defaultTheme = themes[fallbackTheme];
85+
const defaultTheme = themes["default"];
8686
const isThemeProvided = theme !== null && theme !== undefined;
87+
88+
// @ts-ignore
8789
const selectedTheme = isThemeProvided ? themes[theme] : defaultTheme;
90+
8891
const defaultBorderColor =
8992
"border_color" in selectedTheme
9093
? selectedTheme.border_color

0 commit comments

Comments
 (0)