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(ui): correct toast message on domain archive/unarchive undo action

unrenamed07428a677416
diff --git a/apps/web/ui/modals/archive-domain-modal.tsx b/apps/web/ui/modals/archive-domain-modal.tsx
index d9852c5626..eba47b4f43 100644
--- a/apps/web/ui/modals/archive-domain-modal.tsx
+++ b/apps/web/ui/modals/archive-domain-modal.tsx
@@ -31,6 +31,14 @@ const sendArchiveRequest = ({
});
};
+const revalidateDomains = () => {
+ return mutate(
+ (key) => typeof key === "string" && key.startsWith("/api/domains"),
+ undefined,
+ { revalidate: true },
+ );
+};
+
function ArchiveDomainModal({
showArchiveDomainModal,
setShowArchiveDomainModal,
@@ -63,13 +71,7 @@ function ArchiveDomainModal({
return;
}
- await mutate(
- (key) => typeof key === "string" && key.startsWith("/api/domains"),
- undefined,
- {
- revalidate: true,
- },
- );
+ revalidateDomains();
setShowArchiveDomainModal(false);
toastWithUndo({
id: "domain-archive-undo-toast",
@@ -89,12 +91,8 @@ function ArchiveDomainModal({
{
loading: "Undo in progress...",
error: "Failed to roll back changes. An error occurred.",
- success: async () => {
- await mutate(
- (key) => typeof key === "string" && key.startsWith("/api/domains"),
- undefined,
- { revalidate: true },
- );
+ success: () => {
+ revalidateDomains();
return "Undo successful! Changes reverted.";
},
},