Skip to content

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

rename currentScreen

ammarahm-edff4122c0750a
diff --git a/apps/mobile/src/services/Navigation.js b/apps/mobile/src/services/Navigation.js
index f2fbd3504..5d066bbc8 100755
--- a/apps/mobile/src/services/Navigation.js
+++ b/apps/mobile/src/services/Navigation.js
@@ -48,8 +48,10 @@ function routeNeedsUpdate(routeName, callback) {
}
function setRoutesToUpdate(routes) {
+
+ console.log(currentScreen, "current");
if (routes.indexOf(currentScreen) > -1) {
- console.log('updating', currentScreen);
+ console.log('updating screen', currentScreen);
if (
currentScreen === routeNames.NotesPage &&
currentScreen === routeNames.Notebook
@@ -102,7 +104,7 @@ function setHeaderState(name, params, item) {
headerState = item;
}
currentScreen = name;
- headerState.currentScreen = name.toLowerCase();
+ headerState.currentScreen = name;
headerState.verticalMenu = params.menu;
if (headerState) {
@@ -128,7 +130,7 @@ function popToTop() {
rootNavigatorRef.current?.dispatch(StackActions.popToTop());
SettingsService.get().homepage;
setHeaderState(
- SettingsService.get().homepage.toLowerCase(),
+ SettingsService.get().homepage,
{
menu: true,
},
diff --git a/apps/mobile/src/views/Favorites/index.js b/apps/mobile/src/views/Favorites/index.js
index 97b3fd7db..66bfd19f5 100644
--- a/apps/mobile/src/views/Favorites/index.js
+++ b/apps/mobile/src/views/Favorites/index.js
@@ -53,7 +53,7 @@ export const Favorites = ({route, navigation}) => {
return;
}
Navigation.setHeaderState(
- 'favorites',
+ 'Favorites',
{
menu: true,
},
@@ -102,7 +102,7 @@ export const Favorites = ({route, navigation}) => {
}}
loading={loading || localLoad}
placeholderData={{
- heading: 'Your Favorites',
+ heading: 'Your favorites',
paragraph: 'You have not added any notes to favorites yet.',
button: null,
loading: 'Loading your favorites',
diff --git a/apps/mobile/src/views/Folders/index.js b/apps/mobile/src/views/Folders/index.js
index 8e781c06f..88e77d58f 100644
--- a/apps/mobile/src/views/Folders/index.js
+++ b/apps/mobile/src/views/Folders/index.js
@@ -32,7 +32,7 @@ export const Folders = ({route, navigation}) => {
return;
}
Navigation.setHeaderState(
- 'notebooks',
+ 'Notebooks',
{
menu: true,
},
@@ -107,9 +107,9 @@ export const Folders = ({route, navigation}) => {
focused={() => navigation.isFocused()}
loading={loading}
placeholderData={{
- heading: 'Your Notebooks',
+ heading: 'Your notebooks',
paragraph: 'You have not added any notebooks yet.',
- button: 'Add a Notebook',
+ button: 'Add a notebook',
action: _onPressBottomButton,
loading: 'Loading your notebooks',
}}
diff --git a/apps/mobile/src/views/Home/index.js b/apps/mobile/src/views/Home/index.js
index b4ac876e7..eeefa50da 100755
--- a/apps/mobile/src/views/Home/index.js
+++ b/apps/mobile/src/views/Home/index.js
@@ -13,7 +13,7 @@ import {db} from '../../utils/DB';
import {eOnLoadNote, eScrollEvent} from '../../utils/Events';
import {tabBarRef} from '../../utils/Refs';
import Storage from '../../utils/storage';
-
+import Keychain from 'react-native-keychain';
export const Home = ({route, navigation}) => {
const [state, dispatch] = useTracked();
const {loading} = state;
@@ -33,7 +33,7 @@ export const Home = ({route, navigation}) => {
}
Navigation.setHeaderState(
- 'notes',
+ 'Notes',
{
menu: true,
},
@@ -88,7 +88,7 @@ export const Home = ({route, navigation}) => {
navigation.removeListener('blur', onBlur);
};
}, []);
-
+
useEffect(() => {
if (navigation.isFocused()) {
updateSearch();
@@ -128,9 +128,9 @@ export const Home = ({route, navigation}) => {
placeholderText={`Notes you write appear here`}
jumpToDialog={true}
placeholderData={{
- heading: 'Your Notes',
+ heading: 'Your notes',
paragraph: 'You have not added any notes yet.',
- button: 'Add your First Note',
+ button: 'Add your first note',
action: _onPressBottomButton,
loading: 'Loading your notes.',
}}
diff --git a/apps/mobile/src/views/Notebook/index.js b/apps/mobile/src/views/Notebook/index.js
index a6da80609..564e319fe 100644
--- a/apps/mobile/src/views/Notebook/index.js
+++ b/apps/mobile/src/views/Notebook/index.js
@@ -133,7 +133,7 @@ export const Notebook = ({route, navigation}) => {
placeholderData={{
heading: route.params.notebook.title,
paragraph: 'You have not added any topics yet.',
- button: 'Add a Topic',
+ button: 'Add a topic',
action: _onPressBottomButton,
loading: 'Loading notebook topics',
}}
diff --git a/apps/mobile/src/views/Notes/index.js b/apps/mobile/src/views/Notes/index.js
index 75c498f54..6041979e5 100644
--- a/apps/mobile/src/views/Notes/index.js
+++ b/apps/mobile/src/views/Notes/index.js
@@ -132,7 +132,7 @@ export const Notes = ({route, navigation}) => {
return;
}
- Navigation.setHeaderState('Notes', params, {
+ Navigation.setHeaderState('NotesPage', params, {
heading:
params.type === 'tag'
? '#' + params.title
@@ -239,9 +239,9 @@ export const Notes = ({route, navigation}) => {
params.type ? params.type : 'topic.'
}`}
placeholderData={{
- heading: 'Your Notes',
+ heading: 'Your notes',
paragraph: 'You have not added any notes yet.',
- button: 'Add your First Note',
+ button: 'Add your first Note',
action: _onPressBottomButton,
loading: 'Loading your notes.',
}}
diff --git a/apps/mobile/src/views/Settings/index.js b/apps/mobile/src/views/Settings/index.js
index 7c3dbd89b..69747ced3 100644
--- a/apps/mobile/src/views/Settings/index.js
+++ b/apps/mobile/src/views/Settings/index.js
@@ -1,9 +1,7 @@
import React, {createRef, useCallback, useEffect, useState} from 'react';
-import {Image} from 'react-native';
import {
Appearance,
InteractionManager,
- Linking,
Platform,
ScrollView,
TouchableOpacity,
@@ -28,6 +26,7 @@ import Paragraph from '../../components/Typography/Paragraph';
import {useTracked} from '../../provider';
import {Actions} from '../../provider/Actions';
import Backup from '../../services/Backup';
+import BiometricService from '../../services/BiometricService';
import {DDS} from '../../services/DeviceDetection';
import {
eSendEvent,
@@ -58,7 +57,6 @@ import {
import {hexToRGBA, RGB_Linear_Shade} from '../../utils/ColorUtils';
import {db} from '../../utils/DB';
import {
- eCloseProgressDialog,
eOpenLoginDialog,
eOpenPremiumDialog,
eOpenProgressDialog,
@@ -113,7 +111,7 @@ export const Settings = ({navigation}) => {
return;
}
Navigation.setHeaderState(
- 'settings',
+ 'Settings',
{
menu: true,
},
@@ -128,10 +126,10 @@ export const Settings = ({navigation}) => {
navigation.addListener('focus', onFocus);
db.version()
.then((ver) => {
- console.log(ver,"VERSION")
+ console.log(ver, 'VERSION');
setVersion(ver);
})
- .catch((e) => console.log(e,"VER"));
+ .catch((e) => console.log(e, 'VER'));
return () => {
pageIsLoaded = false;
@@ -321,7 +319,7 @@ const AccoutLogoutSection = () => {
/>
<Input
- placeholder="Enter Account Password"
+ placeholder="Enter account password"
onChangeText={(v) => {
passwordValue = v;
}}
@@ -811,7 +809,6 @@ const SettingsAppearanceSection = () => {
}}>
{[
'#e6194b',
- '#3cb44b',
'#ffe119',
'#0560FF',
'#f58231',
@@ -820,7 +817,7 @@ const SettingsAppearanceSection = () => {
'#f032e6',
'#bcf60c',
'#fabebe',
- "#00c853"
+ '#00c853',
].map((item) => (
<PressableButton
key={item}
@@ -943,7 +940,7 @@ const SettingsAppearanceSection = () => {
: 'transparent',
}}
textStyle={{
- fontSize: SIZE.sm,
+ fontSize: SIZE.md,
color:
settings.homepage === item.name
? colors.accent
@@ -972,14 +969,10 @@ const SettingsPrivacyAndSecurity = () => {
const checkVaultStatus = useCallback(() => {
InteractionManager.runAfterInteractions(() => {
db.vault.add('check_no_vault').catch(async (e) => {
- let biometry = await Keychain.getSupportedBiometryType();
- let fingerprint = await Keychain.hasInternetCredentials('nn_vault');
-
+ let biometry = await BiometricService.isBiometryAvailable();
+ let fingerprint = await BiometricService.hasInternetCredentials();
let available = false;
- if (
- biometry === Keychain.BIOMETRY_TYPE.FINGERPRINT ||
- biometry === Keychain.BIOMETRY_TYPE.TOUCH_ID
- ) {
+ if (biometry) {
available = true;
}
if (e.message === db.vault.ERRORS.noVault) {
@@ -1037,14 +1030,20 @@ const SettingsPrivacyAndSecurity = () => {
{vaultStatus.isBiometryAvailable ? (
<CustomButton
key="fingerprintVaultUnlock"
- title="Vault Fingerprint Unlock"
- tagline="Access vault with fingerprint."
+ title="Vault Biometic Unlock"
+ tagline="Access notes in vault using biometrics"
onPress={() => {
openVault({
item: {},
fingerprintAccess: !vaultStatus.biometryEnrolled,
revokeFingerprintAccess: vaultStatus.biometryEnrolled,
novault: true,
+ title: vaultStatus.biometryEnrolled
+ ? 'Revoke biometric unlocking'
+ : 'Enable biometery unlock',
+ description: vaultStatus.biometryEnrolled
+ ? 'Disable biometric unlocking for notes in vault'
+ : 'Disable biometric unlocking for notes in vault',
});
}}
maxWidth="90%"
@@ -1065,13 +1064,15 @@ const SettingsPrivacyAndSecurity = () => {
) : null}
<CustomButton
key="changeVaultPassword"
- title="Change Vault Password"
+ title="Change vault password"
tagline="Setup a new password for the vault"
onPress={() => {
openVault({
item: {},
changePassword: true,
novault: true,
+ title:"Change vault password",
+ description:"Set a new password for your vault."
});
}}
/>
@@ -1079,13 +1080,15 @@ const SettingsPrivacyAndSecurity = () => {
) : (
<CustomButton
key="createVault"
- title="Create Vault"
+ title="Create vault"
tagline="Secure your notes by adding the to the vault."
onPress={() => {
PremiumService.verify(() => {
openVault({
item: {},
novault: false,
+ title:"Create vault",
+ description:"Set a password to create vault and lock notes."
});
});
}}
@@ -1118,7 +1121,7 @@ const SettingsBackupAndRestore = () => {
return (
<>
- <SectionHeader title="Backup & Restore" />
+ <SectionHeader title="Backup & restore" />
{backupItemsList.map((item) => (
<CustomButton
@@ -1195,6 +1198,7 @@ const SettingsBackupAndRestore = () => {
}
}
await SettingsService.set('reminder', item.value);
+ await Backup.run();
});
}
}}
@@ -1218,7 +1222,7 @@ const SettingsBackupAndRestore = () => {
</View>
<CustomButton
- title="Backup Encryption"
+ title="Backup encryption"
tagline="Encrypt all your backups."
onPress={async () => {
if (!user) {
diff --git a/apps/mobile/src/views/Trash/index.js b/apps/mobile/src/views/Trash/index.js
index 50310352c..faf76e371 100644
--- a/apps/mobile/src/views/Trash/index.js
+++ b/apps/mobile/src/views/Trash/index.js
@@ -57,7 +57,7 @@ export const Trash = ({route, navigation}) => {
return;
}
Navigation.setHeaderState(
- 'trash',
+ 'Trash',
{
menu: true,
},