Skip to content

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

improve delete note ux

ammarahm-ed9b1c2971b718
diff --git a/apps/mobile/src/components/Dialog/index.js b/apps/mobile/src/components/Dialog/index.js
index 3efd4abbb..bcca20ca1 100644
--- a/apps/mobile/src/components/Dialog/index.js
+++ b/apps/mobile/src/components/Dialog/index.js
@@ -14,7 +14,7 @@ import NavigationService from '../../services/NavigationService';
import {getElevation, ToastEvent, editing} from '../../utils/utils';
import {dialogActions, updateEvent} from '../DialogManager';
import {eSendEvent} from '../../services/eventManager';
-import {eCloseFullscreenEditor} from '../../services/events';
+import {eCloseFullscreenEditor, eOnLoadNote} from '../../services/events';
export class Dialog extends Component {
constructor(props) {
@@ -51,7 +51,12 @@ export class Dialog extends Component {
visible: false,
});
if (editing.currentlyEditing) {
- NavigationService.goBack();
+ if (DDS.isTab) {
+ eSendEvent(eCloseFullscreenEditor);
+ eSendEvent(eOnLoadNote, {type: 'new'});
+ } else {
+ NavigationService.goBack();
+ }
}
break;
}
diff --git a/apps/mobile/src/views/Editor/index.js b/apps/mobile/src/views/Editor/index.js
index 6034d8cab..d9f747824 100755
--- a/apps/mobile/src/views/Editor/index.js
+++ b/apps/mobile/src/views/Editor/index.js
@@ -407,6 +407,7 @@ const Editor = ({navigation, noMenu}) => {
onPress={() => {
eSendEvent(eOpenFullscreenEditor);
setFullscreen(true);
+ editing.isFullscreen = true;
post(
JSON.stringify({
type: 'nomenu',
@@ -535,10 +536,12 @@ const Editor = ({navigation, noMenu}) => {
useEffect(() => {
editing.currentlyEditing = true;
+
let handleBack;
if (!noMenu && DDS.isTab) {
handleBack = BackHandler.addEventListener('hardwareBackPress', () => {
simpleDialogEvent(TEMPLATE_EXIT_FULLSCREEN());
+ editing.isFullscreen = false;
return true;
});
} else if (!DDS.isTab) {