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
- [ ] User info missing on first start
- [x] User info missing on first start
- [ ] i18n not loading
- [ ] Logging out and in again does not work
- [ ] Clipboard library not working
@ -59,6 +59,7 @@ yarn start
- [ ] Direct Messages https://github.com/nostr-protocol/nips/blob/master/04.md
### Note
- [ ] Autoscroll to reply
- [ ] Mentions https://github.com/nostr-protocol/nips/blob/master/08.md
- [ ] Reactions https://github.com/nostr-protocol/nips/blob/master/25.md

View File

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

View File

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