Using captcha_solved
This commit is contained in:
parent
162b0042ed
commit
3f6d589e93
|
@ -3,7 +3,6 @@ import { useEffect, useState } from 'react';
|
|||
import { defineMessages, useIntl } from 'react-intl';
|
||||
|
||||
import { closeModal } from 'soapbox/actions/modals';
|
||||
import { startOnboarding } from 'soapbox/actions/onboarding';
|
||||
import { useApi, useAppDispatch, useInstance } from 'soapbox/hooks';
|
||||
import { captchaSchema, type CaptchaData } from 'soapbox/schemas/captcha';
|
||||
import toast from 'soapbox/toast';
|
||||
|
@ -73,7 +72,6 @@ const useCaptcha = () => {
|
|||
|
||||
dispatch(closeModal('CAPTCHA'));
|
||||
toast.success(messages.sucessMessage);
|
||||
dispatch(startOnboarding());
|
||||
});
|
||||
} catch (e) {
|
||||
setTryAgain(true);
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
import React from 'react';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
import { startOnboarding } from 'soapbox/actions/onboarding';
|
||||
import { Modal, Stack } from 'soapbox/components/ui';
|
||||
import { useAppDispatch } from 'soapbox/hooks';
|
||||
|
||||
import Captcha from './captcha';
|
||||
|
||||
|
@ -12,13 +10,9 @@ interface ICaptchaModal {
|
|||
}
|
||||
|
||||
const CaptchaModal: React.FC<ICaptchaModal> = ({ onClose }) => {
|
||||
const dispatch = useAppDispatch();
|
||||
return (
|
||||
<Modal
|
||||
title={<FormattedMessage id='nostr_signup.captcha_title' defaultMessage='Human Verification' />} onClose={() => {
|
||||
onClose();
|
||||
dispatch(startOnboarding());
|
||||
}} width='sm'
|
||||
title={<FormattedMessage id='nostr_signup.captcha_title' defaultMessage='Human Verification' />} width='sm'
|
||||
>
|
||||
<Stack justifyContent='center' alignItems='center' space={4}>
|
||||
<Captcha />
|
||||
|
|
|
@ -3,7 +3,6 @@ import React, { useEffect, useMemo, useState } from 'react';
|
|||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
import { fetchAccount } from 'soapbox/actions/accounts';
|
||||
import { openModal } from 'soapbox/actions/modals';
|
||||
import { logInNostr } from 'soapbox/actions/nostr';
|
||||
import { closeSidebar } from 'soapbox/actions/sidebar';
|
||||
import CopyableInput from 'soapbox/components/copyable-input';
|
||||
|
@ -72,7 +71,6 @@ const KeygenStep: React.FC<IKeygenStep> = ({ onClose }) => {
|
|||
dispatch(closeSidebar());
|
||||
}
|
||||
|
||||
await dispatch(openModal('CAPTCHA'));
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
|
@ -35,11 +35,18 @@ const SoapboxMount = () => {
|
|||
|
||||
const soapboxConfig = useSoapboxConfig();
|
||||
|
||||
const showCaptcha = account && !account?.source?.ditto.captcha_solved;
|
||||
const needsOnboarding = useAppSelector(state => state.onboarding.needsOnboarding);
|
||||
const showOnboarding = account && needsOnboarding;
|
||||
|
||||
if (showCaptcha) {
|
||||
dispatch(openModal('CAPTCHA'));
|
||||
}
|
||||
|
||||
if (showOnboarding) {
|
||||
dispatch(openModal('ONBOARDING_FLOW'));
|
||||
}
|
||||
|
||||
const { redirectRootNoLogin, gdpr } = soapboxConfig;
|
||||
|
||||
// @ts-ignore: I don't actually know what these should be, lol
|
||||
|
|
Loading…
Reference in New Issue