diff --git a/src/features/ui/components/modals/nostr-login-modal/nostr-login-modal.tsx b/src/features/ui/components/modals/nostr-login-modal/nostr-login-modal.tsx index 4d5b4eb4c..b5c1c95d7 100644 --- a/src/features/ui/components/modals/nostr-login-modal/nostr-login-modal.tsx +++ b/src/features/ui/components/modals/nostr-login-modal/nostr-login-modal.tsx @@ -7,10 +7,11 @@ type Step = 'extension' | 'key-add'; interface INostrLoginModal { onClose: (type?: string) => void; + step?: Step; } -const NostrLoginModal: React.FC = ({ onClose }) => { - const [step, setStep] = useState(window.nostr ? 'extension' : 'key-add'); +const NostrLoginModal: React.FC = ({ onClose, step: firstStep }) => { + const [step, setStep] = useState(firstStep ?? (window.nostr ? 'extension' : 'key-add')); const handleClose = () => onClose('NOSTR_LOGIN'); diff --git a/src/features/ui/components/modals/nostr-signup-modal/steps/key-step.tsx b/src/features/ui/components/modals/nostr-signup-modal/steps/key-step.tsx index a95287f0d..817814dce 100644 --- a/src/features/ui/components/modals/nostr-signup-modal/steps/key-step.tsx +++ b/src/features/ui/components/modals/nostr-signup-modal/steps/key-step.tsx @@ -19,7 +19,7 @@ const KeyStep: React.FC = ({ setStep, onClose }) => { const onAltClick = () => { onClose(); - dispatch(openModal('NOSTR_LOGIN')); + dispatch(openModal('NOSTR_LOGIN', { step: 'key-add' })); }; return (