Просмотр исходного кода

♻️ refactor(profile): simplify user profile state management

- remove redundant local state management for user profile
- directly use user data from useAuth hook instead of duplicating state
- eliminate unnecessary useEffect for profile data processing
yourname 4 месяцев назад
Родитель
Сommit
c1a492416b
1 измененных файлов с 0 добавлено и 11 удалено
  1. 0 11
      mini/src/pages/profile/index.tsx

+ 0 - 11
mini/src/pages/profile/index.tsx

@@ -10,19 +10,8 @@ import { Navbar } from '@/components/ui/navbar'
 import './index.css'
 
 const ProfilePage: React.FC = () => {
-  // const [userProfile, setUserProfile] = useState<UserProfile | null>(null)
   const { user: userProfile, logout, isLoading: loading } = useAuth()
 
-  // useEffect(() => {
-  //   if (user) {
-  //     setUserProfile({
-  //       ...user,
-  //       avatar: user.avatar || 'https://images.unsplash.com/photo-1494790108755-2616b612b786?w=160&h=160&fit=crop&crop=face',
-  //     })
-  //   }
-  //   setLoading(false)
-  // }, [user])
-
   const handleLogout = async () => {
     try {
       Taro.showModal({