fix(webui): narrow local trigger source label

maintainer edit: avoid optional source access after extracting automation source kind for TypeScript build.
This commit is contained in:
chengyongru 2026-06-30 14:39:41 +08:00 committed by Xubin Ren
parent 2ebf5c4972
commit 09bde468eb

View File

@ -168,12 +168,13 @@ export function MessageBubble({
const reasoningStreaming = !!(message.role === "assistant" && message.reasoningStreaming);
const hasReasoning = reasoning.length > 0 || reasoningStreaming;
const automationSourceKind = message.source?.kind;
const automationSourceName = message.source?.label?.trim();
const automationSourceLabel = (
automationSourceKind === "cron"
|| automationSourceKind === "local_trigger"
|| automationSourceKind === "trigger"
)
? (message.source.label?.trim() || t("message.automationSourceFallback"))
? (automationSourceName || t("message.automationSourceFallback"))
: "";
const automationTriggeredLabel = t("message.automationTriggered");