Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix accept invitation bug

Steven Tey6d189a6217b9
diff --git a/apps/web/ui/modals/accept-invite-modal.tsx b/apps/web/ui/modals/accept-invite-modal.tsx
index 911e3c6618..dd5cfe96f9 100644
--- a/apps/web/ui/modals/accept-invite-modal.tsx
+++ b/apps/web/ui/modals/accept-invite-modal.tsx
@@ -51,7 +51,7 @@ function AcceptInviteModal({
fetch(`/api/workspaces/${slug}/invites/accept`, {
method: "POST",
headers: { "Content-Type": "application/json" },
- }).then(async () => {
+ }).then(() => {
if (session?.user) {
posthog.identify(session.user["id"], {
email: session.user.email,
@@ -61,10 +61,10 @@ function AcceptInviteModal({
posthog.capture("accepted_workspace_invite", {
workspace: slug,
});
- await mutatePrefix("/api/workspaces");
- router.replace(`/${slug}/links`);
+ router.replace(`/${slug}`);
setShowAcceptInviteModal(false);
toast.success("You now are a part of this workspace!");
+ mutatePrefix("/api/workspaces");
});
}}
loading={accepting}