Files
sub2api-mobile/app/(tabs)/index.tsx

13 lines
398 B
TypeScript
Raw Normal View History

import { Redirect } from 'expo-router';
2026-03-07 18:12:39 +08:00
import { adminConfigState, hasAuthenticatedAdminSession } from '@/src/store/admin-config';
2026-03-08 20:53:15 +08:00
const { useSnapshot } = require('valtio/react');
export default function IndexScreen() {
2026-03-08 20:53:15 +08:00
const config = useSnapshot(adminConfigState);
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
}