Skip to content

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

fix android app hangin on opening ActionSheet

ammarahm-eda6087e3fdb1e
diff --git a/apps/mobile/src/components/Dialog/index.js b/apps/mobile/src/components/Dialog/index.js
index ee9d51f15..4bdaa9314 100644
--- a/apps/mobile/src/components/Dialog/index.js
+++ b/apps/mobile/src/components/Dialog/index.js
@@ -57,7 +57,8 @@ export const Dialog = ({ context = 'global' }) => {
};
const show = data => {
- if (data.context && data.context !== context) return;
+ if (!data.context) data.context = 'global';
+ if (data.context !== context) return;
setDialogInfo(data);
setVisible(true);
};
diff --git a/apps/mobile/src/components/GeneralSheet/index.js b/apps/mobile/src/components/GeneralSheet/index.js
index 66f5ff594..c9bb5e765 100644
--- a/apps/mobile/src/components/GeneralSheet/index.js
+++ b/apps/mobile/src/components/GeneralSheet/index.js
@@ -15,7 +15,7 @@ import SheetWrapper from '../Sheet';
import Heading from '../Typography/Heading';
import Paragraph from '../Typography/Paragraph';
-const GeneralSheet = ({ context }) => {
+const GeneralSheet = ({ context = 'global' }) => {
const [state] = useTracked();
const { colors } = state;
const [visible, setVisible] = useState(false);
@@ -35,9 +35,8 @@ const GeneralSheet = ({ context }) => {
}, [visible]);
const open = async data => {
- if ((data.context && !context) || (data.context && data.context !== context)) {
- return;
- }
+ if (!data.context) data.context = 'global';
+ if (data.context !== context) return;
if (visible || dialogData) {
setDialogData(null);
setVisible(false);
@@ -45,6 +44,7 @@ const GeneralSheet = ({ context }) => {
}
setDialogData(data);
setVisible(true);
+ console.log('calling open now');
if (data.editor) {
editor.current.refocus = false;
if (editing.keyboardState) {
diff --git a/apps/mobile/src/views/Settings/applock.js b/apps/mobile/src/views/Settings/applock.js
index 2fa5c894d..686162275 100644
--- a/apps/mobile/src/views/Settings/applock.js
+++ b/apps/mobile/src/views/Settings/applock.js
@@ -17,11 +17,11 @@ import { Button } from '../../components/Button';
import { getElevation } from '../../utils';
import umami from '../../utils/umami';
-const AppLock = ({ welcome }) => {
+const AppLock = ({ welcome, s = 0 }) => {
const [state] = useTracked();
const { colors } = state;
const settings = useSettingStore(state => state.settings);
- const [step, setStep] = useState(0);
+ const [step, setStep] = useState(s);
const modes = [
{
@@ -164,9 +164,8 @@ const AppLock = ({ welcome }) => {
AppLock.present = async isWelcome => {
let available = await BiometricService.isBiometryAvailable();
let user = await db.user.getUser();
- if (!available && !user) return;
presentSheet({
- component: <AppLock welcome={isWelcome} />
+ component: <AppLock welcome={isWelcome} s={!available && !user ? 1 : 0} />
});
};