refactor(pi): use explicit branches for image warning labels

This commit is contained in:
YEONGUK LEE
2026-11-03 21:37:40 +00:00
committed by paseo-bot[bot]
parent 860c55e59e
commit 49b71c9473
@@ -1414,10 +1414,15 @@ export class PiRpcAgentSession implements AgentSession {
}
const imageCount = payload.images?.length ?? 0;
const label =
payload.text.trim().length === 0 && imageCount > 0
? `${imageCount} ${imageCount === 1 ? "image" : "images"}`
: payload.text;
const isImageOnly = payload.text.trim().length === 0 && imageCount > 0;
let label = payload.text;
if (isImageOnly) {
if (imageCount === 1) {
label = "1 image";
} else {
label = `${imageCount} images`;
}
}
const submission: PiPendingSteerSubmission = {
text: payload.text,
label,