From f024f75a9b208f04dad0855c6e7d171e121e1b1b Mon Sep 17 00:00:00 2001 From: undefined Date: Sat, 21 Dec 2024 12:51:23 +0800 Subject: [PATCH] ui: contest_balloon: fix default value --- packages/ui-default/pages/contest_balloon.page.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/ui-default/pages/contest_balloon.page.tsx b/packages/ui-default/pages/contest_balloon.page.tsx index bae997895..b876d5812 100644 --- a/packages/ui-default/pages/contest_balloon.page.tsx +++ b/packages/ui-default/pages/contest_balloon.page.tsx @@ -65,11 +65,8 @@ function Balloon({ tdoc, val }) { } async function handleSetColor(tdoc) { - let val = tdoc.balloon; - if (!val) { - val = {}; - for (const pid of tdoc.pids) val[+pid] = { color: '#ffffff', name: '' }; - } + const val = tdoc.balloon || {}; + for (const pid of tdoc.pids) val[+pid] ||= { color: '#ffffff', name: '' }; Notification.info(i18n('Loading...')); const action = await new ActionDialog({ $body: tpl(<>