Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

586 B
Raw Blame
import { isNativeApp } from '../native/platform';

/**
 * A full page load to `url`. In the apps it waits for the first page to finish
 * loading: started earlier, it cancels that load, and the shell answers a
 * cancelled load with its "Server not reachable" page, which is where a
 * signed-out user opening the app for the first time ended up.
 */
export function hardNavigate(url: string): void {
  const go = () => {
    window.location.href = url;
  };
  if (isNativeApp() && document.readyState !== 'complete') window.addEventListener('load', go, { once: true });
  else go();
}