Merge branch 'main' into dependabot/npm_and_yarn/typescript-4.8.4

This commit is contained in:
KoalaSat 2022-10-25 13:25:58 +00:00 committed by GitHub
commit 460e35f67c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 11 deletions

View File

@ -32,7 +32,7 @@ yarn start
### Bugs ### Bugs
- [ ] User info missing on first start - [x] User info missing on first start
- [ ] i18n not loading - [ ] i18n not loading
- [ ] Logging out and in again does not work - [ ] Logging out and in again does not work
- [ ] Clipboard library not working - [ ] Clipboard library not working
@ -50,7 +50,7 @@ yarn start
- [ ] Other Rooms - [ ] Other Rooms
### Profile ### Profile
- [ ] Verify NIP-05 https://github.com/nostr-protocol/nips/blob/master/05.md - [ ] Verify NIP-05 https://github.com/nostr-protocol/nips/blob/master/05.md
- [ ] Verify LNURL https://github.com/andrerfneves/lightning-address - [ ] Verify LNURL https://github.com/andrerfneves/lightning-address
@ -59,6 +59,7 @@ yarn start
- [ ] Direct Messages https://github.com/nostr-protocol/nips/blob/master/04.md - [ ] Direct Messages https://github.com/nostr-protocol/nips/blob/master/04.md
### Note ### Note
- [ ] Autoscroll to reply - [ ] Autoscroll to reply
- [ ] Mentions https://github.com/nostr-protocol/nips/blob/master/08.md - [ ] Mentions https://github.com/nostr-protocol/nips/blob/master/08.md
- [ ] Reactions https://github.com/nostr-protocol/nips/blob/master/25.md - [ ] Reactions https://github.com/nostr-protocol/nips/blob/master/25.md

View File

@ -29,10 +29,11 @@ export const ConfigPage: React.FC = () => {
const onPressLogout: () => void = () => { const onPressLogout: () => void = () => {
if (database) { if (database) {
dropTables(database).then(() => { dropTables(database).then(() => {
setPrivateKey(''); EncryptedStorage.removeItem('privateKey').then(() => {
relayPool?.unsubscribeAll(); setPrivateKey('');
EncryptedStorage.removeItem('privateKey'); relayPool?.unsubscribeAll();
setPage('landing'); setPage('landing');
});
}); });
} }
}; };

View File

@ -10,10 +10,11 @@ import { Event, EventKind } from '../../lib/nostr/Events';
import { AppContext } from '../../Contexts/AppContext'; import { AppContext } from '../../Contexts/AppContext';
import { insertUserContact } from '../../Functions/DatabaseFunctions/Users'; import { insertUserContact } from '../../Functions/DatabaseFunctions/Users';
import EncryptedStorage from 'react-native-encrypted-storage'; import EncryptedStorage from 'react-native-encrypted-storage';
import { getPublickey } from '../../lib/nostr/Bip';
export const LandingPage: React.FC = () => { export const LandingPage: React.FC = () => {
const { database, setPage } = useContext(AppContext); const { database, setPage } = useContext(AppContext);
const { privateKey, publicKey, relayPool, setPrivateKey } = useContext(RelayPoolContext); const { privateKey, publicKey, relayPool, setPublicKey } = useContext(RelayPoolContext);
const { t } = useTranslation('common'); const { t } = useTranslation('common');
const [loading, setLoading] = useState<boolean>(false); const [loading, setLoading] = useState<boolean>(false);
const [status, setStatus] = useState<number>(0); const [status, setStatus] = useState<number>(0);
@ -107,10 +108,12 @@ export const LandingPage: React.FC = () => {
}; };
const onPress: () => void = () => { const onPress: () => void = () => {
setLoading(true); if (privateKey && privateKey !== '') {
setPrivateKey(inputValue); setLoading(true);
setStatus(1); setPublicKey(getPublickey(privateKey));
EncryptedStorage.setItem('privateKey', inputValue); setStatus(1);
EncryptedStorage.setItem('privateKey', privateKey);
}
}; };
const statusName: { [status: number]: string } = { const statusName: { [status: number]: string } = {