mirror of
https://github.com/khairul169/vaulterm.git
synced 2025-04-28 16:49:39 +07:00
20 lines
473 B
TypeScript
20 lines
473 B
TypeScript
import React from "react";
|
|
import { Redirect } from "expo-router";
|
|
import { useTermSession } from "@/stores/terminal-sessions";
|
|
import { useServer } from "@/stores/app";
|
|
|
|
export default function index() {
|
|
const { sessions, curSession } = useTermSession();
|
|
const curServer = useServer();
|
|
|
|
if (!curServer) {
|
|
return <Redirect href="/server" />;
|
|
}
|
|
|
|
return (
|
|
<Redirect
|
|
href={sessions.length > 0 && curSession >= 0 ? "/terminal" : "/hosts"}
|
|
/>
|
|
);
|
|
}
|