2026-03-07 23:33:33 +08:00
|
|
|
import { Redirect } from 'expo-router';
|
2026-03-07 18:12:39 +08:00
|
|
|
|
2026-03-09 12:31:08 +08:00
|
|
|
import { adminConfigState, hasAuthenticatedAdminSession } from '@/src/store/admin-config';
|
2026-03-08 20:53:15 +08:00
|
|
|
|
|
|
|
|
const { useSnapshot } = require('valtio/react');
|
|
|
|
|
|
2026-03-07 23:33:33 +08:00
|
|
|
export default function IndexScreen() {
|
2026-03-08 20:53:15 +08:00
|
|
|
const config = useSnapshot(adminConfigState);
|
2026-03-09 12:31:08 +08:00
|
|
|
const hasAccount = hasAuthenticatedAdminSession(config);
|
2026-03-08 20:53:15 +08:00
|
|
|
|
|
|
|
|
return <Redirect href={hasAccount ? '/monitor' : '/login'} />;
|
2026-03-07 18:12:39 +08:00
|
|
|
}
|