refactor(onboarding): compute the load error message once (#351)
All checks were successful
PR Check — Frontend / frontend (pull_request) Successful in 1m43s

Self-review tidy: `errorMessage(e)` was evaluated twice in `refresh`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
le king fu 2026-10-03 19:23:43 -04:00
parent f77ce94505
commit 76fd8d376a

View file

@ -93,8 +93,9 @@ export function useOnboardingChecklist() {
const snapshot = await getOnboardingCounters();
dispatch({ type: "LOAD_DONE", snapshot });
} catch (e) {
logError("Onboarding: failed to load checklist counters", errorMessage(e));
dispatch({ type: "LOAD_ERROR", error: errorMessage(e) });
const error = errorMessage(e);
logError("Onboarding: failed to load checklist counters", error);
dispatch({ type: "LOAD_ERROR", error });
}
}, []);