mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-18 17:16:26 +00:00
indicate on reload if login was already complete and data is loading
This commit is contained in:
parent
5e93246b95
commit
b9bda67bc2
1 changed files with 7 additions and 1 deletions
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue