Add useEffect on showCaptcha

This commit is contained in:
danidfra 2024-10-10 17:46:38 -03:00
parent bf16faccf0
commit 130d4b149b
1 changed files with 6 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import React, { Suspense } from 'react';
import React, { Suspense, useEffect } from 'react';
import { Toaster } from 'react-hot-toast';
import { BrowserRouter, Switch, Redirect, Route } from 'react-router-dom';
import { CompatRouter } from 'react-router-dom-v5-compat';
@ -39,9 +39,11 @@ const SoapboxMount = () => {
const needsOnboarding = useAppSelector(state => state.onboarding.needsOnboarding);
const showOnboarding = account && needsOnboarding;
if (showCaptcha) {
dispatch(openModal('CAPTCHA'));
}
useEffect(() => {
if (showCaptcha) {
dispatch(openModal('CAPTCHA'));
}
}, [showCaptcha]);
if (showOnboarding) {
dispatch(openModal('ONBOARDING_FLOW'));