Skip to content

Commit c7568d1

Browse files
fix(dashboard): narrow nullable cause before label lookup
Co-authored-by: Alfonso <alfonso-magic-context@users.noreply.github.com>
1 parent 787d613 commit c7568d1

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

packages/dashboard/src/components/shared/CacheTimeline.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,10 @@ export default function CacheTimeline(props: {
156156
<div class="ctx-drop-tip-title">⬇ Magic Context reclaimed context</div>
157157
<div class="ctx-drop-tip-row">{formatDateTime(tip().event.timestamp)}</div>
158158
<div class="ctx-drop-tip-row">
159-
{tip().event.cause
160-
? `Cause: ${cacheCauseLabel(tip().event.cause)}`
161-
: "Cause not recorded"}
159+
{(() => {
160+
const cause = tip().event.cause;
161+
return cause ? `Cause: ${cacheCauseLabel(cause)}` : "Cause not recorded";
162+
})()}
162163
</div>
163164
<div class="ctx-drop-tip-hint">click → jump to step</div>
164165
</div>

0 commit comments

Comments
 (0)