KeygenStep: log the user in

environments/review-ditto-auth-csh1vn/deployments/4454
Alex Gleason 2024-03-17 17:49:41 -05:00
rodzic ab0f9b0a43
commit ddee1d9d4e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -3,6 +3,7 @@ import React, { useEffect, useMemo, useState } from 'react';
import { FormattedMessage } from 'react-intl';
import { fetchAccount } from 'soapbox/actions/accounts';
import { logInNostr } from 'soapbox/actions/nostr';
import CopyableInput from 'soapbox/components/copyable-input';
import EmojiGraphic from 'soapbox/components/emoji-graphic';
import { Button, Stack, Modal, FormGroup, Text, Tooltip } from 'soapbox/components/ui';
@ -39,9 +40,11 @@ const KeygenStep: React.FC<IKeygenStep> = ({ onClose }) => {
const handleCopy = () => setDownloaded(true);
const handleNext = () => {
NKeys.add(secretKey);
// TODO: log in, close modal
const handleNext = async () => {
const signer = NKeys.add(secretKey);
const pubkey = await signer.getPublicKey();
dispatch(logInNostr(pubkey));
onClose();
};
return (