Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

Merge branch 'main' into 181/new

Ashish Viradiya75f5e9b55d2b
diff --cc lib/utils.ts
index 712d502b,6a50a1e3..af8803ca
--- a/lib/utils.ts
+++ b/lib/utils.ts
@@@ -555,32 -552,10 +554,32 @@@ export const getBreadcrumbPath = (path
{ name: "Home", pathLink: "/documents" },
...segments.map((segment, index) => {
currentPath += `/${slugify(segment)}`;
- return {
- name: segment,
- pathLink: currentPath
+ return {
+ name: segment,
+ pathLink: currentPath,
};
- })
+ }),
];
};
+
+export const handleInvitationStatus = (
+ invitationStatus: 'accepted' | 'teamMember',
+ queryParams: ParsedUrlQuery,
+ router: NextRouter,
+) => {
+ switch (invitationStatus) {
+ case 'accepted':
+ toast.success("Welcome to the team! You've successfully joined.");
+ break;
+ case 'teamMember':
+ toast.error("You've already accepted this invitation!");
+ break;
+ default:
+ toast.error("Invalid invitation status");
+ }
+
+ delete queryParams["invitation"];
+ router.replace("/documents", undefined, {
+ shallow: true,
+ });
- };
++};