Conversation
Ref/new flow
…nto ref/newFlow
Ref/new flow
fix: schedule
Fix/schedule
fix: service staff map
feat: staff service view
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
fix: schedule for tofay
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 836816ceb9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const newHours = mapScheduleSlotsToWorkingHours(slots); | ||
| if (!newHours) return; // Нет данных — оставляем текущие |
There was a problem hiding this comment.
Reset calendar hours when fetched schedule is empty
When loadSchedule gets a valid response with zero work slots, mapScheduleSlotsToWorkingHours returns null and this early return skips all state updates. That leaves workingHours from the previously selected employee/location visible, so users can see and interact with stale availability after switching to someone with an empty schedule. Instead of returning, this path should explicitly clear/update workingHours (and range metadata) for the requested interval.
Useful? React with 👍 / 👎.
| partialize: state => ({ | ||
| badgeVariant: state.badgeVariant, | ||
| locationId: state.locationId, | ||
| }), |
There was a problem hiding this comment.
Do not persist selected location without user validation
Persisting locationId in local storage can leak location context across auth transitions, while downstream code prefers stored selection over currentUser.location_id (for example in calendar-context/index.tsx). If a session expires or a different account logs in without explicit logout cleanup, the app can continue querying the old location and show unauthorized/incorrect data. This value should be recomputed from the current user (or validated) on startup rather than blindly restored.
Useful? React with 👍 / 👎.
No description provided.