Skip to content

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

fix ActionSheet does not hide

ammarahm-ed3de3210882c7
diff --git a/apps/mobile/src/components/ActionSheetComponent/GetPremium.js b/apps/mobile/src/components/ActionSheetComponent/GetPremium.js
index 49a3fcd3c..1313c49f5 100644
--- a/apps/mobile/src/components/ActionSheetComponent/GetPremium.js
+++ b/apps/mobile/src/components/ActionSheetComponent/GetPremium.js
@@ -10,7 +10,11 @@ import {
eUnSubscribeEvent,
} from '../../services/EventManager';
import {dWidth, editing, getElevation} from '../../utils';
-import {eCloseActionSheet, eOpenPremiumDialog, eShowGetPremium} from '../../utils/Events';
+import {
+ eCloseActionSheet,
+ eOpenPremiumDialog,
+ eShowGetPremium,
+} from '../../utils/Events';
import {SIZE} from '../../utils/SizeUtils';
import {sleep} from '../../utils/TimeUtils';
import {post} from '../../views/Editor/Functions';
@@ -132,14 +136,11 @@ export const GetPremium = ({close, context = 'global', offset = 0}) => {
<Button
onPress={async () => {
open(null);
+ eSendEvent(eCloseActionSheet);
if (editing.isFocused) {
post('blur');
- await sleep(300);
- } else {
- eSendEvent(eCloseActionSheet);
- await sleep(300);
-
}
+ await sleep(300);
eSendEvent(eOpenPremiumDialog);
}}
width={80}
diff --git a/apps/mobile/src/components/DialogManager/index.js b/apps/mobile/src/components/DialogManager/index.js
index 6a7c82307..5d4c4efde 100644
--- a/apps/mobile/src/components/DialogManager/index.js
+++ b/apps/mobile/src/components/DialogManager/index.js
@@ -141,7 +141,7 @@ export class DialogManager extends Component {
eSubscribeEvent(eOnLoadNote, this.loadNote);
eSubscribeEvent(eOpenActionSheet, this._showActionSheet);
- eSubscribeEvent(eCloseActionSheet, this._hideSimpleDialog);
+ eSubscribeEvent(eCloseActionSheet, this._hideActionSheet);
eSubscribeEvent(eOpenSimpleDialog, this._showSimpleDialog);
eSubscribeEvent(eCloseSimpleDialog, this._hideSimpleDialog);
@@ -224,12 +224,12 @@ export class DialogManager extends Component {
simpleDialog: data,
},
() => {
- this.simpleDialog.show();
+ this.simpleDialog?.show();
},
);
};
_hideSimpleDialog = (data) => {
- this.simpleDialog.hide();
+ this.simpleDialog?.hide();
};
onActionSheetHide = () => {