Skip to content

armgit / pibot

Public Imported from GitHub
0

Open-source, local-first AI agent team for your desktop: multi-agent group chats, computer use, browser, MCP, routines and approvals. macOS, Windows, Linux + Android. Built on pi.

563 B
Raw Blame
import { Redirect } from "expo-router";
import { useMobileSelector } from "../src/runtime/context.tsx";

// Decide the first screen declaratively: an imperative replace from the root layout could run
// before the navigator mounted and was dropped in release builds, leaving an unpaired phone on
// the tabs with no way to pair.
export default function Index() {
  const mobile = useMobileSelector((s) => ({ ready: s.ready, devices: s.devices }));
  if (!mobile.ready) return null;
  return <Redirect href={mobile.devices.length ? "/(tabs)/chat" : "/pair"} />;
}