fix: TypeScript null safety fixes for strict mode
- RateAnalysis: null guard on price_incl in timeline trace - Layout: explicit null check on alertCount, use ?? for user.name Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ebbffa3137
commit
8948d3abf6
2 changed files with 3 additions and 3 deletions
|
|
@ -39,7 +39,7 @@ export default function Layout({ children }: { children: ReactNode }) {
|
|||
<NavLink key={to} to={to} className={({ isActive }) => isActive ? 'active' : ''}>
|
||||
<Icon {...ICON} />
|
||||
{label}
|
||||
{to === '/market' && alertCount ? (
|
||||
{to === '/market' && alertCount != null && alertCount > 0 ? (
|
||||
<span style={{
|
||||
marginLeft: 'auto', background: 'var(--danger)', color: '#fff',
|
||||
borderRadius: 10, fontSize: 10, fontWeight: 700,
|
||||
|
|
@ -49,7 +49,7 @@ export default function Layout({ children }: { children: ReactNode }) {
|
|||
</NavLink>
|
||||
))}
|
||||
</nav>
|
||||
<div className="sidebar-user">{user.name || user.email}</div>
|
||||
<div className="sidebar-user">{user.name ?? user.email}</div>
|
||||
</aside>
|
||||
|
||||
<header className="top-bar">
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ function buildTimelineTraces(entries: TimelineEntry[]) {
|
|||
mode: 'lines+markers' as const,
|
||||
name: room,
|
||||
x: pts.map(p => p.scraped_at),
|
||||
y: pts.map(p => p.price_incl),
|
||||
y: pts.map(p => p.price_incl ?? null),
|
||||
line: { color: colors[i % colors.length], width: 2 },
|
||||
marker: { size: 5, color: colors[i % colors.length] },
|
||||
hovertemplate: `${room}: £%{y:.2f}<extra></extra>`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue