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.

Update accept-invite-modal.tsx

Kiran K406549c5bd05
diff --git a/apps/web/ui/modals/accept-invite-modal.tsx b/apps/web/ui/modals/accept-invite-modal.tsx
index a9caa58f4c..6a92b04de8 100644
--- a/apps/web/ui/modals/accept-invite-modal.tsx
+++ b/apps/web/ui/modals/accept-invite-modal.tsx
@@ -54,10 +54,10 @@ function AcceptInviteModal({
workspace: slug,
});
- router.replace(`/${slug}`);
+ await mutatePrefix(["/api/workspaces", "/api/programs"]);
+ router.refresh();
setShowAcceptInviteModal(false);
toast.success("You now are a part of this workspace!");
- mutatePrefix("/api/workspaces");
} finally {
setAccepting(false);
}
@@ -78,11 +78,10 @@ function AcceptInviteModal({
return;
}
+ await mutatePrefix("/api/workspaces");
+ router.refresh();
setShowAcceptInviteModal(false);
toast.success("You have declined the invite.");
- mutatePrefix("/api/workspaces");
- // Use window.location for a full page reload to clear any invite query params
- window.location.href = "/";
} finally {
setDeclining(false);
}