Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

14 linesCodeBlameRaw
1/** `/inbox` is Notifications now: the page, with the same query (`?view=done` is `/notifications/done`). */
2import { redirect } from "react-router";
3
4import type { Route } from "./+types/inbox-moved";
5import { movedView } from "../lib/tab-paths";
6
7export function loader({ request }: Route.LoaderArgs) {
8 const url = new URL(request.url);
9 url.searchParams.delete("_routes");
10 const view = movedView(url);
11 if (view) return redirect(view, 301);
12 const query = url.searchParams.toString();
13 return redirect(`/notifications${query ? `?${query}` : ""}`, 301);
14}