Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

fix(guide): prevent polling from overwriting user's tab navigation

kevinf6a081812e5c
diff --git a/web/app/(workspace)/guide/hooks/useGuideSession.ts b/web/app/(workspace)/guide/hooks/useGuideSession.ts
index 67d013c85..2b8c8dbde 100644
--- a/web/app/(workspace)/guide/hooks/useGuideSession.ts
+++ b/web/app/(workspace)/guide/hooks/useGuideSession.ts
@@ -165,7 +165,9 @@ export function useGuideSession() {
};
let currentIndex = prev.current_index;
- if (typeof payload.current_index === "number") {
+ // Only accept current_index from server/payload if user hasn't navigated yet.
+ // This prevents polling from overwriting the user's tab selection.
+ if (typeof payload.current_index === "number" && prev.current_index < 0) {
currentIndex = payload.current_index;
}