style: format practice session files
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
f74db216da
commit
9c646acc16
|
|
@ -127,10 +127,10 @@ export function StudentPracticeClient({
|
|||
// - If cache has data (from ConfigureClient mutation): uses cache immediately
|
||||
// - If no cache but initialActiveSession exists: uses server props as initial data
|
||||
// - If neither: fetches from API (shows loading state briefly)
|
||||
const {
|
||||
data: fetchedPlan,
|
||||
isLoading: isPlanLoading,
|
||||
} = useActiveSessionPlan(studentId, initialActiveSession)
|
||||
const { data: fetchedPlan, isLoading: isPlanLoading } = useActiveSessionPlan(
|
||||
studentId,
|
||||
initialActiveSession
|
||||
)
|
||||
|
||||
// Current plan from mutations or fetched data (priority order)
|
||||
// Mutations take priority (most recent user action), then fetched/cached data
|
||||
|
|
|
|||
|
|
@ -96,10 +96,7 @@ async function updateSessionPlan({
|
|||
* @param playerId - The player ID to fetch the session for
|
||||
* @param initialData - Optional initial data from server-side props (avoids loading state on direct page load)
|
||||
*/
|
||||
export function useActiveSessionPlan(
|
||||
playerId: string | null,
|
||||
initialData?: SessionPlan | null
|
||||
) {
|
||||
export function useActiveSessionPlan(playerId: string | null, initialData?: SessionPlan | null) {
|
||||
return useQuery({
|
||||
queryKey: sessionPlanKeys.active(playerId ?? ''),
|
||||
queryFn: () => fetchActiveSessionPlan(playerId!),
|
||||
|
|
|
|||
Loading…
Reference in New Issue