mirror of
https://gitee.com/wanwujie/sub2api-mobile
synced 2026-04-22 15:54:45 +08:00
feat: refine expo admin mobile flows
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Tabs } from 'expo-router';
|
||||
import { Redirect, Tabs } from 'expo-router';
|
||||
import { ChartNoAxesCombined, Settings2, Users } from 'lucide-react-native';
|
||||
|
||||
import { adminConfigState } from '@/src/store/admin-config';
|
||||
@@ -9,6 +9,10 @@ export default function TabsLayout() {
|
||||
const config = useSnapshot(adminConfigState);
|
||||
const hasAccount = Boolean(config.baseUrl.trim());
|
||||
|
||||
if (!hasAccount) {
|
||||
return <Redirect href="/login" />;
|
||||
}
|
||||
|
||||
return (
|
||||
<Tabs
|
||||
initialRouteName={hasAccount ? 'monitor' : 'settings'}
|
||||
@@ -53,7 +57,6 @@ export default function TabsLayout() {
|
||||
}}
|
||||
/>
|
||||
<Tabs.Screen name="groups" options={{ href: null }} />
|
||||
<Tabs.Screen name="keys" options={{ href: null }} />
|
||||
<Tabs.Screen name="accounts" options={{ href: null }} />
|
||||
</Tabs>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user