refactor(onboarding): compute the load error message once (#351)
All checks were successful
PR Check — Frontend / frontend (pull_request) Successful in 1m43s
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:
parent
f77ce94505
commit
76fd8d376a
1 changed files with 3 additions and 2 deletions
|
|
@ -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 });
|
||||
}
|
||||
}, []);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue