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.

Clear pending identity sync state when modal is dismissed

Kiran Kb8e4f33f40f3
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-details-form.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-details-form.tsx
index 18784826bf..53ce72a642 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-details-form.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-details-form.tsx
@@ -322,6 +322,9 @@ function BasicInfoForm({
onCancel: async () => {
await submitProfile(false);
},
+ onDismiss: () => {
+ pendingSubmitRef.current = null;
+ },
});
return (
diff --git a/apps/web/app/app.dub.co/(dashboard)/account/settings/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/account/settings/page-client.tsx
index 34a77c77bc..da4963b162 100644
--- a/apps/web/app/app.dub.co/(dashboard)/account/settings/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/account/settings/page-client.tsx
@@ -140,6 +140,9 @@ export function SettingsPageClient() {
onCancel: async () => {
await finishPendingPatch(false);
},
+ onDismiss: () => {
+ pendingPatchRef.current = null;
+ },
});
const requestSubmit = ({
diff --git a/apps/web/ui/modals/identity-sync-confirm-modal.tsx b/apps/web/ui/modals/identity-sync-confirm-modal.tsx
index 587c66e5ae..b00aef1677 100644
--- a/apps/web/ui/modals/identity-sync-confirm-modal.tsx
+++ b/apps/web/ui/modals/identity-sync-confirm-modal.tsx
@@ -121,6 +121,7 @@ type IdentitySyncConfirmModalProps = {
next: IdentitySyncSnapshot;
onConfirm: () => Promise<void> | void;
onCancel?: () => Promise<void> | void;
+ onDismiss?: () => void;
};
function IdentitySyncConfirmModal({
@@ -133,6 +134,7 @@ function IdentitySyncConfirmModal({
next,
onConfirm,
onCancel,
+ onDismiss,
}: {
showModal: boolean;
setShowModal: Dispatch<SetStateAction<boolean>>;
@@ -167,7 +169,7 @@ function IdentitySyncConfirmModal({
<Modal
showModal={showModal}
setShowModal={setShowModal}
- onClose={handleCancel}
+ onClose={onDismiss}
preventDefaultClose={isLoading}
className="max-w-md"
>