Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

327 B
Raw Blame
/**
 * The react-router index of the current browser history entry, used to walk
 * back to an origin instead of pushing it again.
 */
export const readHistoryIndex = (): number | undefined => {
  const index = (window.history.state as { idx?: unknown } | null)?.idx;
  return typeof index === 'number' ? index : undefined;
};