mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-29 14:37:44 +02:00
The email CTA now deep-links to /invite/{id} instead of the generic app
URL. If the user isn't logged in, they're redirected to login with a
?next= param that brings them back to the invite page.
Changes:
- Backend: GET /api/invitations/{id} endpoint (enriched with workspace/inviter names)
- Backend: Email template now links to /invite/{invitationId}
- Frontend: Shared InvitePage component (packages/views/invite/)
- Frontend: Web route at (auth)/invite/[id], Desktop route at invite/:id
- Frontend: /invite/ excluded from navigation history persistence
33 lines
875 B
TypeScript
33 lines
875 B
TypeScript
"use client";
|
|
|
|
import { create } from "zustand";
|
|
import { createJSONStorage, persist } from "zustand/middleware";
|
|
import { createPersistStorage } from "../platform/persist-storage";
|
|
import { defaultStorage } from "../platform/storage";
|
|
|
|
const EXCLUDED_PREFIXES = ["/login", "/pair/", "/invite/"];
|
|
|
|
interface NavigationState {
|
|
lastPath: string;
|
|
onPathChange: (path: string) => void;
|
|
}
|
|
|
|
export const useNavigationStore = create<NavigationState>()(
|
|
persist(
|
|
(set) => ({
|
|
lastPath: "/issues",
|
|
|
|
onPathChange: (path: string) => {
|
|
if (!EXCLUDED_PREFIXES.some((prefix) => path.startsWith(prefix))) {
|
|
set({ lastPath: path });
|
|
}
|
|
},
|
|
}),
|
|
{
|
|
name: "multica_navigation",
|
|
storage: createJSONStorage(() => createPersistStorage(defaultStorage)),
|
|
partialize: (state) => ({ lastPath: state.lastPath }),
|
|
}
|
|
)
|
|
);
|