Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

update

ammarahm-edd3ff3eb06017
diff --git a/apps/mobile/src/views/Login/index.js b/apps/mobile/src/views/Login/index.js
index d5a5406bc..84e33e636 100644
--- a/apps/mobile/src/views/Login/index.js
+++ b/apps/mobile/src/views/Login/index.js
@@ -1,22 +1,28 @@
-import React, { createRef, useEffect, useState } from 'react';
-import { ActivityIndicator, BackHandler, SafeAreaView, Text, TouchableOpacity, View } from 'react-native';
+import React, {createRef, useEffect, useState} from 'react';
+import {
+ ActivityIndicator,
+ BackHandler,
+ SafeAreaView,
+ Text,
+ TouchableOpacity,
+ View,
+} from 'react-native';
import * as Animatable from 'react-native-animatable';
-import { TextInput } from 'react-native-gesture-handler';
+import {TextInput} from 'react-native-gesture-handler';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
-import { useIsFocused } from 'react-navigation-hooks';
-import { opacity, pv, SIZE, WEIGHT } from '../../common/common';
-import { Header } from '../../components/header';
-import { useTracked } from '../../provider';
-import { ACTIONS } from '../../provider/actions';
-import { eSendEvent } from '../../services/eventManager';
-import { eCloseSideMenu, refreshNotesPage } from '../../services/events';
-import { validatePass, validateUsername } from '../../services/validation';
-import { db, DDS, ToastEvent } from '../../utils/utils';
+import {useIsFocused} from 'react-navigation-hooks';
+import {opacity, pv, SIZE, WEIGHT} from '../../common/common';
+import {Header} from '../../components/header';
+import {useTracked} from '../../provider';
+import {ACTIONS} from '../../provider/actions';
+import {eSendEvent} from '../../services/eventManager';
+import {eCloseSideMenu, refreshNotesPage} from '../../services/events';
+import {validatePass, validateUsername} from '../../services/validation';
+import {db, DDS, ToastEvent} from '../../utils/utils';
-
-export const Login = ({ navigation }) => {
+export const Login = ({navigation}) => {
const [state, dispatch] = useTracked();
- const { colors, isLoginNavigator } = state;
+ const {colors, isLoginNavigator} = state;
const _email = createRef();
const _pass = createRef();
const [status, setStatus] = useState('Logging in...');
@@ -71,11 +77,8 @@ export const Login = ({ navigation }) => {
try {
console.log('here reacched');
await db.user.login(username, password);
-
} catch (e) {
-
console.log(e, 'ERROR');
-
setTimeout(() => {
ToastEvent.show(e.message, 'error');
setLoggingIn(false);
@@ -88,12 +91,12 @@ export const Login = ({ navigation }) => {
try {
user = await db.user.get();
console.log('user', user);
- dispatch({ type: ACTIONS.USER, user: user });
+ dispatch({type: ACTIONS.USER, user: user});
ToastEvent.show(`Logged in as ${username}`, 'success');
navigation.goBack();
await db.sync();
eSendEvent(refreshNotesPage);
- dispatch({ type: ACTIONS.ALL });
+ dispatch({type: ACTIONS.ALL});
} catch (e) {
console.log(e, 'getUSer');
ToastEvent.show(e.message, 'error');
diff --git a/apps/mobile/src/views/Settings/index.js b/apps/mobile/src/views/Settings/index.js
index 834cf1589..7b45d5ba6 100644
--- a/apps/mobile/src/views/Settings/index.js
+++ b/apps/mobile/src/views/Settings/index.js
@@ -62,7 +62,7 @@ export const Settings = ({navigation}) => {
noBottomButton={true}>
<View
style={{
- marginTop: Platform.OS == 'ios' ? 135 - 60 : 155 - 60,
+ marginTop: Platform.OS == 'ios' ? 125 - 60 : 125 - 60,
}}
/>
@@ -130,7 +130,7 @@ export const Settings = ({navigation}) => {
<TouchableOpacity
activeOpacity={0.6}
onPress={() => {
- Clipboard.setString('string');
+ Clipboard.setString(key);
ToastEvent.show('Recovery key copied!', 'success', 'local');
}}
style={{
@@ -209,7 +209,6 @@ export const Settings = ({navigation}) => {
fontFamily: WEIGHT.bold,
textAlignVertical: 'center',
color: colors.accent,
-
borderBottomColor: colors.nav,
borderBottomWidth: 0.5,
paddingBottom: 3,
@@ -240,6 +239,7 @@ export const Settings = ({navigation}) => {
backgroundColor: colors.accent,
borderRadius: 5,
padding: 5,
+ paddingHorizontal: 12,
}}>
<View
style={{
@@ -282,7 +282,14 @@ export const Settings = ({navigation}) => {
name: 'Backup my notes',
func: () => {},
},
-
+ {
+ name: 'Data recovery key',
+ func: async () => {
+ let k = await db.user.key();
+ setKey(k.key);
+ setModalVisible(true);
+ },
+ },
{
name: 'My vault',
func: () => {},
diff --git a/apps/mobile/src/views/Signup/index.js b/apps/mobile/src/views/Signup/index.js
index 532d0214d..0d205f37c 100644
--- a/apps/mobile/src/views/Signup/index.js
+++ b/apps/mobile/src/views/Signup/index.js
@@ -6,6 +6,7 @@ import {
View,
Modal,
Clipboard,
+ ActivityIndicator,
} from 'react-native';
import {TextInput} from 'react-native-gesture-handler';
import QRCode from 'react-native-qrcode-generator';
@@ -75,7 +76,7 @@ export const Signup = ({navigation}) => {
try {
user = await db.user.user.get();
let k = await db.user.key();
- setKey(k);
+ setKey(k.key);
dispatch({type: ACTIONS.USER, user: user});
setTimeout(() => {
@@ -102,7 +103,7 @@ export const Signup = ({navigation}) => {
<Modal
animated={true}
animationType="fade"
- visible={!modalVisible}
+ visible={modalVisible}
transparent={true}>
<View
style={{
@@ -166,7 +167,7 @@ export const Signup = ({navigation}) => {
<TouchableOpacity
activeOpacity={0.6}
onPress={() => {
- Clipboard.setString('string');
+ Clipboard.setString(key);
ToastEvent.show('Recovery key copied!', 'success', 'local');
}}
style={{