Fix navigating between NostrSignup and NostrLogin

This commit is contained in:
Alex Gleason 2024-03-17 18:00:32 -05:00
parent ddee1d9d4e
commit e866b95282
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 4 additions and 3 deletions

View File

@ -7,10 +7,11 @@ type Step = 'extension' | 'key-add';
interface INostrLoginModal {
onClose: (type?: string) => void;
step?: Step;
}
const NostrLoginModal: React.FC<INostrLoginModal> = ({ onClose }) => {
const [step, setStep] = useState<Step>(window.nostr ? 'extension' : 'key-add');
const NostrLoginModal: React.FC<INostrLoginModal> = ({ onClose, step: firstStep }) => {
const [step, setStep] = useState<Step>(firstStep ?? (window.nostr ? 'extension' : 'key-add'));
const handleClose = () => onClose('NOSTR_LOGIN');

View File

@ -19,7 +19,7 @@ const KeyStep: React.FC<IKeyStep> = ({ setStep, onClose }) => {
const onAltClick = () => {
onClose();
dispatch(openModal('NOSTR_LOGIN'));
dispatch(openModal('NOSTR_LOGIN', { step: 'key-add' }));
};
return (