Skip to content

Commit 79e0e7a

Browse files
committed
feat: улучшить обработку имени цвета в состоянии Scoreboard для более точного управления
1 parent 4c66382 commit 79e0e7a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/OBS_Components/Scoreboard/AdminPanel/store/scoreboardStore.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,11 +365,16 @@ export const useScoreboardStore = create<ScoreboardStore>((set, get) => {
365365
const incomingColor = state.colors ?? state.color;
366366
if (incomingColor) {
367367
const currentColor = get().color;
368+
const incomingName =
369+
"name" in incomingColor && typeof incomingColor.name === "string"
370+
? incomingColor.name
371+
: undefined;
372+
368373
set({
369374
color: {
370375
...currentColor,
371376
...incomingColor,
372-
name: incomingColor.name ?? currentColor.name ?? "Custom",
377+
name: incomingName ?? currentColor.name ?? "Custom",
373378
_lastEdit: receiveTime,
374379
_receivedAt: receiveTime,
375380
},

0 commit comments

Comments
 (0)