Skip to content

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

fix dialog not opening

ammarahm-ede395dd6bcdd3
diff --git a/apps/mobile/src/components/ActionSheetComponent/index.js b/apps/mobile/src/components/ActionSheetComponent/index.js
index 33f619319..6b241019a 100644
--- a/apps/mobile/src/components/ActionSheetComponent/index.js
+++ b/apps/mobile/src/components/ActionSheetComponent/index.js
@@ -625,7 +625,9 @@ export const ActionSheetComponent = ({
negativeText: 'Cancel',
positivePress: async () => {
await db.trash.delete(note.id);
- useTrashStore.getState().setTrash();
+ Navigation.setRoutesToUpdate([
+ Navigation.routeNames.Trash
+ ]);
useSelectionStore.getState().setSelectionMode(false);
ToastEvent.show({
heading: 'Permanantly deleted items',
@@ -633,7 +635,7 @@ export const ActionSheetComponent = ({
context: 'local'
});
},
- positiveType: 'errorShade'
+ positiveType: 'errorShade',
});
}
}
diff --git a/apps/mobile/src/components/Dialog/index.js b/apps/mobile/src/components/Dialog/index.js
index a0a5b3fbc..9c7ebf292 100644
--- a/apps/mobile/src/components/Dialog/index.js
+++ b/apps/mobile/src/components/Dialog/index.js
@@ -53,10 +53,9 @@ export const Dialog = ({context = 'global'}) => {
};
const show = data => {
- if (data.context && data.context === context) {
- setDialogInfo(data);
- setVisible(true);
- }
+ if (data.context && data.context !== context) return;
+ setDialogInfo(data);
+ setVisible(true);
};
const hide = () => {
diff --git a/apps/mobile/src/components/DialogManager/index.js b/apps/mobile/src/components/DialogManager/index.js
index b77ad1731..38bfc4ddb 100644
--- a/apps/mobile/src/components/DialogManager/index.js
+++ b/apps/mobile/src/components/DialogManager/index.js
@@ -265,7 +265,7 @@ export class DialogManager extends Component {
</ActionSheetWrapper>
)}
- <Dialog />
+ <Dialog context="global" />
<AddTopicDialog
ref={ref => (this.addTopicsDialog = ref)}
close={() => {