Fix navigating between NostrSignup and NostrLogin
This commit is contained in:
parent
ddee1d9d4e
commit
e866b95282
|
@ -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');
|
||||
|
||||
|
|
|
@ -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 (
|
||||
|
|
Loading…
Reference in New Issue