16 lines
963 B
Markdown
16 lines
963 B
Markdown
# Task Detail
|
|
|
|
## 2025-12-18 Session 6
|
|
|
|
### Execution Reason
|
|
User asked how to update the navigation state after login.
|
|
|
|
### Execution Process
|
|
1. **Investigation**: Checked `src/components/TheNavigation.vue` and `src/pages/index.vue`. Found they were accessing `userStore.user`, but the store (updated in Session 1) actually exposes `userStore.userInfo`.
|
|
2. **Fix**: Replaced all occurrences of `userStore.user` with `userStore.userInfo` in both `TheNavigation.vue` and `index.vue`.
|
|
3. **Result**: Since Pinia stores are reactive, correctly binding to `userStore.userInfo` ensures that when `userStore.login` updates `userInfo`, the UI (Navigation and Home page) automatically re-renders to show the logged-in state (username, logout button, etc.).
|
|
|
|
### Execution Result
|
|
- Fixed the reactivity issue by correcting the property name from `user` to `userInfo`.
|
|
- Navigation bar will now correctly toggle between "Login" and "User Profile" upon successful login.
|