Skip to content
Myr

moved.ts

This file

Path

apps/web/src/features/inbox/moved.ts

18 lines · 695 bytes · TypeScript

Last changed by

Merge redesign into mainoscabrielbefore adoptioncaedd21

History of this file

Take it

Merge redesign into mainoscabrielbefore adoptioncaedd21

lines 1–18why, one step back
1import { redirect } from "@tanstack/react-router";
2import { Effect } from "effect";34import { INBOX_PATH } from "../shared/paths.ts";56// Home and Today folded into the inbox (ADR 0041). The worker answers a document load with its own 3017// (`canonicalAddress`); this sends on a navigation inside the app, from a page kept before the move.8// It rejects with the redirect: the lint keeps a bare `throw` for `Error`s, which a redirect is not.9export const movedToInbox = ({10 location,11}: {12 readonly location: { readonly searchStr: string };13}): Promise<never> =>14 Effect.runPromise(15 Effect.fail(16 redirect({ href: `${INBOX_PATH}${location.searchStr}`, statusCode: 301 })17 )18 );