Skip to content

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

fix crash

ammarahm-eddd449d6379e7
diff --git a/apps/mobile/src/components/AppLoader/index.js b/apps/mobile/src/components/AppLoader/index.js
index b40d62d58..c4ff822f4 100644
--- a/apps/mobile/src/components/AppLoader/index.js
+++ b/apps/mobile/src/components/AppLoader/index.js
@@ -1,4 +1,4 @@
-import React, {useEffect, useState} from 'react';
+import React, {useEffect, useRef, useState} from 'react';
import {Appearance} from 'react-native';
import {SafeAreaView, View} from 'react-native';
import Animated, {Easing} from 'react-native-reanimated';
@@ -52,6 +52,7 @@ const AppLoader = ({onLoad}) => {
const user = useUserStore(state => state.user);
const verifyUser = useUserStore(state => state.verifyUser);
const setVerifyUser = useUserStore(state => state.setVerifyUser);
+ const pwdInput = useRef();
const load = async value => {
if (verifyUser) return;
@@ -224,6 +225,7 @@ const AppLoader = ({onLoad}) => {
</Paragraph>
<Seperator half />
<Input
+ fwdRef={pwdInput}
secureTextEntry
placeholder="Enter account password"
onChangeText={v => (passwordValue = v)}
diff --git a/apps/mobile/src/components/Input/index.js b/apps/mobile/src/components/Input/index.js
index 08965be22..fdbef273d 100644
--- a/apps/mobile/src/components/Input/index.js
+++ b/apps/mobile/src/components/Input/index.js
@@ -204,7 +204,7 @@ const Input = ({
top={10}
bottom={10}
onPress={() => {
- fwdRef.current?.blur();
+ fwdRef?.current?.blur();
setSecureEntry(!secureEntry);
}}
style={{
diff --git a/apps/mobile/src/components/PublishNoteDialog/index.js b/apps/mobile/src/components/PublishNoteDialog/index.js
index 78f469746..8e6bd924f 100644
--- a/apps/mobile/src/components/PublishNoteDialog/index.js
+++ b/apps/mobile/src/components/PublishNoteDialog/index.js
@@ -43,6 +43,7 @@ const PublishNoteDialog = () => {
note &&
`https://monograph.notesnook.com/${db?.monographs.monograph(note?.id)}`;
const isPublished = note && db?.monographs.isPublished(note?.id);
+ const pwdInput = useRef();
useEffect(() => {
eSubscribeEvent(eOpenPublishNoteDialog, open);
@@ -299,6 +300,7 @@ const PublishNoteDialog = () => {
{isLocked ? (
<>
<Input
+ fwdRef={pwdInput}
onChangeText={value => (passwordValue = value)}
blurOnSubmit
secureTextEntry
diff --git a/apps/mobile/src/views/Settings/index.js b/apps/mobile/src/views/Settings/index.js
index 96128b3ff..ddb675108 100644
--- a/apps/mobile/src/views/Settings/index.js
+++ b/apps/mobile/src/views/Settings/index.js
@@ -93,7 +93,6 @@ import Storage from '../../utils/storage';
import {sleep} from '../../utils/TimeUtils';
import {Button as MButton} from '../../components/Button/index';
import Share from 'react-native-share';
-let menuRef = createRef();
const format = ver => {
let parts = ver.toString().split('');
@@ -460,6 +459,7 @@ const AccoutLogoutSection = () => {
const [visible, setVisible] = useState(false);
const [deleteAccount, setDeleteAccount] = useState(false);
const [loading, setLoading] = useState(false);
+ const pwdInput = useRef();
return (
user && (
@@ -532,6 +532,7 @@ const AccoutLogoutSection = () => {
<Input
placeholder="Enter account password"
+ fwdRef={pwdInput}
onChangeText={v => {
passwordValue = v;
}}
@@ -1113,6 +1114,7 @@ const SettingsAppearanceSection = () => {
const {colors} = state;
const settings = useSettingStore(state => state.settings);
const [collapsed, setCollapsed] = useState(true);
+ const menuRef = useRef();
function changeColorScheme(colors = COLOR_SCHEME, accent = ACCENT) {
let newColors = setColorScheme(colors, accent);
dispatch({type: Actions.THEME, colors: newColors});