Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Minor UI improvement.

Ivan Vasilovbb1b6fb68bd1
diff --git a/studio/components/interfaces/Account/TOTPFactors/AddNewFactorModal.tsx b/studio/components/interfaces/Account/TOTPFactors/AddNewFactorModal.tsx
index def81e023c6..58925ab8aec 100644
--- a/studio/components/interfaces/Account/TOTPFactors/AddNewFactorModal.tsx
+++ b/studio/components/interfaces/Account/TOTPFactors/AddNewFactorModal.tsx
@@ -163,7 +163,12 @@ const SecondStep = ({
buttonLabel="Confirm"
buttonLoadingLabel="Confirming"
loading={isVerifying}
- onSelectCancel={() => factor && unenroll({ factorId: factor.id })}
+ onSelectCancel={() => {
+ // If a factor has been created (but not verified), unenroll it. This will be run as a
+ // side effect so that it's not confusing to the user why the modal stays open while
+ // unenrolling.
+ if (factor) unenroll({ factorId: factor.id })
+ }}
onSelectConfirm={() => factor && challengeAndVerify({ factorId: factor.id, code })}
>
<Modal.Content>