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.

Keep identity-sync modal open when profile save fails

Kiran Kbf3613b5e530
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 e5f15db573..18784826bf 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
@@ -277,7 +277,7 @@ function BasicInfoForm({
});
if (!result?.data) {
- return;
+ throw new Error("Profile update failed");
}
if (result.data.needsEmailVerification) {
@@ -304,11 +304,8 @@ function BasicInfoForm({
return;
}
- try {
- await saveProfile({ ...pending, syncIdentity });
- } finally {
- pendingSubmitRef.current = null;
- }
+ await saveProfile({ ...pending, syncIdentity });
+ pendingSubmitRef.current = null;
};
const { setShowModal: setShowConfirmModal, confirmModal } =
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 54f7c28a34..34a77c77bc 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
@@ -117,12 +117,12 @@ export function SettingsPageClient() {
syncIdentity,
});
pending.onSuccess();
+ pendingPatchRef.current = null;
} catch (error) {
toast.error(
error instanceof Error ? error.message : "Something went wrong.",
);
- } finally {
- pendingPatchRef.current = null;
+ throw error;
}
};