kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Fix navigating between NostrSignup and NostrLogin
rodzic
ddee1d9d4e
commit
e866b95282
|
@ -7,10 +7,11 @@ type Step = 'extension' | 'key-add';
|
||||||
|
|
||||||
interface INostrLoginModal {
|
interface INostrLoginModal {
|
||||||
onClose: (type?: string) => void;
|
onClose: (type?: string) => void;
|
||||||
|
step?: Step;
|
||||||
}
|
}
|
||||||
|
|
||||||
const NostrLoginModal: React.FC<INostrLoginModal> = ({ onClose }) => {
|
const NostrLoginModal: React.FC<INostrLoginModal> = ({ onClose, step: firstStep }) => {
|
||||||
const [step, setStep] = useState<Step>(window.nostr ? 'extension' : 'key-add');
|
const [step, setStep] = useState<Step>(firstStep ?? (window.nostr ? 'extension' : 'key-add'));
|
||||||
|
|
||||||
const handleClose = () => onClose('NOSTR_LOGIN');
|
const handleClose = () => onClose('NOSTR_LOGIN');
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ const KeyStep: React.FC<IKeyStep> = ({ setStep, onClose }) => {
|
||||||
|
|
||||||
const onAltClick = () => {
|
const onAltClick = () => {
|
||||||
onClose();
|
onClose();
|
||||||
dispatch(openModal('NOSTR_LOGIN'));
|
dispatch(openModal('NOSTR_LOGIN', { step: 'key-add' }));
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Ładowanie…
Reference in New Issue