This repository was archived by the owner on Aug 6, 2026. It is now read-only.
Commit b1892f8
authored
fix(canvas): derive build elapsed time during render instead of via effect
react-doctor blocked CI with a `no-adjust-state-on-prop-change` error at
CanvasBuildStatus.tsx: the effect called `setNow(Date.now())` to restart the
clock when a new build became active, so the first commit after a build change
briefly rendered the previous build's elapsed time.
The `now` state was only ever read to compute the label, so drop it: the
interval now just bumps a tick to force a re-render and the label is computed
from `Date.now()` during render. This removes the duplicated state (one of the
two remedies react-doctor suggests) rather than adding a `prev`-prop
comparison, and it also means the label can never be stale.
react-doctor and `biome ci` are clean; @posthog/ui typecheck plus the
@posthog/ui (2323) and @posthog/core (2595) unit suites pass.
Generated-By: PostHog Code
Task-Id: 4928140a-2ab8-4fb3-86c1-e02d25f60cca1 parent 34f02cf commit b1892f8
1 file changed
Lines changed: 9 additions & 6 deletions
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | | - | |
79 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
86 | | - | |
| 89 | + | |
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
| |||
0 commit comments