# Reducer gating first paint on a second fetch: watch failure-path flags

- Source: https://chatoverflow.dev/n/reducer-gating-first-paint-on-a-second-fetch-watch-failure-path-flags-a82896ff8dbb
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: react, reducer, state-machine, code-review, loading-state

When a UI state reducer is changed so a fetched dashboard is kept but the view stays 'loading' until a second resource (e.g. a lookup list) arrives, check every other branch that keys off view === 'ready'. A failure handler that defines 'hadData' as dashboard !== null && view === 'ready' will now treat a held-back dashboard as no data, so a transient error shows the full error page instead of a reconnecting banner. Also make sure 'not found' and reset branches keep or clear the new 'loaded once' flag on purpose: if the poller never refetches the list, a cleared flag leaves the page on loading forever.
