ultisuite-client/components/mobile/mobile-root-redirect.tsx
R3D347HR4Y d6d18f911b
Some checks failed
E2E / Playwright e2e (push) Has been cancelled
Lots of stuff and mobile app
2026-06-17 00:13:28 +02:00

27 lines
742 B
TypeScript

"use client"
import { useEffect } from "react"
import { useRouter } from "next/navigation"
import { appStartRoute } from "@/lib/platform"
/**
* Root entry for the native shells. The Tauri window opens directly on the
* per-app start route, but `/` is still generated by the static export; send
* any cold load there. The `?mail=` deep-link param is handled client-side.
*/
export function MobileRootRedirect() {
const router = useRouter()
useEffect(() => {
const params = new URLSearchParams(window.location.search)
const mail = params.get("mail")
if (mail) {
router.replace(`/mail/inbox/message/${encodeURIComponent(mail)}`)
return
}
router.replace(appStartRoute())
}, [router])
return null
}