2025-02-10 01:32:16 +03:00
|
|
|
import { urls, useConceptNavigation } from '@/app';
|
2025-02-12 13:41:58 +03:00
|
|
|
import { useAuthSuspense } from '@/features/auth';
|
2025-02-12 21:36:03 +03:00
|
|
|
|
2025-03-13 20:20:59 +03:00
|
|
|
import { PARAMETER } from '@/utils/constants';
|
|
|
|
|
2025-02-19 23:29:45 +03:00
|
|
|
export function HomePage() {
|
2024-06-07 20:17:03 +03:00
|
|
|
const router = useConceptNavigation();
|
2025-01-28 19:45:31 +03:00
|
|
|
const { isAnonymous } = useAuthSuspense();
|
2024-06-07 20:17:03 +03:00
|
|
|
|
2025-02-15 18:32:37 +03:00
|
|
|
if (isAnonymous) {
|
2025-03-13 20:20:59 +03:00
|
|
|
// Note: Timeout is needed to let router initialize
|
|
|
|
setTimeout(() => router.replace({ path: urls.login }), PARAMETER.minimalTimeout);
|
2025-02-15 18:32:37 +03:00
|
|
|
} else {
|
2025-03-13 20:20:59 +03:00
|
|
|
setTimeout(() => router.replace({ path: urls.library }), PARAMETER.minimalTimeout);
|
2025-02-15 18:32:37 +03:00
|
|
|
}
|
2024-06-07 20:17:03 +03:00
|
|
|
|
2025-02-15 18:32:37 +03:00
|
|
|
return null;
|
2024-06-07 20:17:03 +03:00
|
|
|
}
|