From b851e40f33ae34e3658af33b2bb699bba4e50740 Mon Sep 17 00:00:00 2001 From: Sergei Date: Sat, 24 Jan 2026 20:51:52 -0800 Subject: [PATCH] fix: Resolve TypeScript errors in Button and ultravoxService MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Button.tsx: Replace `condition && style` with ternary operators to ensure array elements are always ViewStyle/TextStyle (not false) - ultravoxService.ts: Add 'in' type guard before accessing optional 'location' property on alert objects 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- components/ui/Button.tsx | 6 +++--- services/ultravoxService.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/ui/Button.tsx b/components/ui/Button.tsx index ec8692b..49c2715 100644 --- a/components/ui/Button.tsx +++ b/components/ui/Button.tsx @@ -34,8 +34,8 @@ export function Button({ styles.base, styles[variant], styles[`size_${size}`], - fullWidth && styles.fullWidth, - isDisabled && styles.disabled, + fullWidth ? styles.fullWidth : {}, + isDisabled ? styles.disabled : {}, style as ViewStyle, ]; @@ -43,7 +43,7 @@ export function Button({ styles.text, styles[`text_${variant}`], styles[`text_${size}`], - isDisabled && styles.textDisabled, + isDisabled ? styles.textDisabled : {}, ]; return ( diff --git a/services/ultravoxService.ts b/services/ultravoxService.ts index 3823a57..4084eb1 100644 --- a/services/ultravoxService.ts +++ b/services/ultravoxService.ts @@ -88,7 +88,7 @@ CURRENT STATUS (Today - ${todayData?.day || 'Wednesday'}): const emoji = alert.severity === 'critical' ? '🔴' : alert.severity === 'high' ? '🟠' : alert.severity === 'medium' ? '🟡' : '🟢'; context += ` ${emoji} ${alert.type.replace(/_/g, ' ').toUpperCase()} at ${alert.time}`; if (alert.note) context += ` - ${alert.note}`; - if (alert.location) context += ` (${alert.location})`; + if ('location' in alert && alert.location) context += ` (${alert.location})`; context += '\n'; }); }