diff --git a/frontend/src/components/forms/LoginForm.jsx b/frontend/src/components/forms/LoginForm.jsx index d190cba2..2c1f02db 100644 --- a/frontend/src/components/forms/LoginForm.jsx +++ b/frontend/src/components/forms/LoginForm.jsx @@ -26,6 +26,7 @@ const LoginForm = () => { const logout = useAuthStore((s) => s.logout); const isAuthenticated = useAuthStore((s) => s.isAuthenticated); const initData = useAuthStore((s) => s.initData); + const user = useAuthStore((s) => s.user); const fetchVersion = useSettingsStore((s) => s.fetchVersion); const storedVersion = useSettingsStore((s) => s.version); @@ -87,10 +88,15 @@ const LoginForm = () => { }, []); useEffect(() => { + // If user is loaded, set isLoading to true so the UI indicates login is complete and is loading data + if (user) { + setIsLoading(true); + } + if (isAuthenticated) { navigate('/channels'); } - }, [isAuthenticated, navigate]); + }, [isAuthenticated, user, navigate]); const handleInputChange = (e) => { setFormData({