indicate on reload if login was already complete and data is loading

This commit is contained in:
dekzter 2026-02-25 12:52:14 -05:00
parent 5e93246b95
commit b9bda67bc2

View file

@ -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({