Skip to content

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

fix intent clearing

ammarahm-edc7bd5f353f77
diff --git a/apps/mobile/App.js b/apps/mobile/App.js
index 2d88a5788..b0df03d43 100644
--- a/apps/mobile/App.js
+++ b/apps/mobile/App.js
@@ -86,11 +86,14 @@ const onAppStateChanged = async (state) => {
try {
if (getIntentOnAppLoadProcessed()) {
if (Platform.OS === 'android') {
+ console.log('calling intent from here too');
let intent = await ReceiveSharingIntent.getFileNames();
+ console.log("INTENT RECIEVED",intent);
if (intent) {
IntentService.setIntent(intent);
IntentService.check(loadIntent);
}
+ ReceiveSharingIntent.clearFileNames();
}
} else {
if (!db || !db.notes) return;
@@ -164,6 +167,8 @@ const App = () => {
EV.subscribe('user:loggedOut', onLogout);
EV.subscribe('user:checkStatus', PremiumService.onUserStatusCheck);
return () => {
+ setIntentOnAppLoadProcessed(false);
+ setAppIsInitialized(false);
EV.subscribe('db:refresh', onSyncComplete);
EV.unsubscribe('user:loggedOut', onLogout);
EV.unsubscribe('db:sync', partialSync);
diff --git a/apps/mobile/src/services/IntentService.js b/apps/mobile/src/services/IntentService.js
index 4d631dfcd..0b19ba53c 100644
--- a/apps/mobile/src/services/IntentService.js
+++ b/apps/mobile/src/services/IntentService.js
@@ -1,5 +1,4 @@
-import { ToastAndroid } from 'react-native';
-import {Linking, NativeModules, Platform} from 'react-native';
+import { Linking, NativeModules, Platform } from 'react-native';
const {ReceiveSharingIntent} = NativeModules;
let currentIntent = null;
const isIos = Platform.OS === 'ios';
@@ -19,10 +18,12 @@ function getIntent() {
}
} else {
_data = await ReceiveSharingIntent.getFileNames();
+
}
} catch (e) {
reject(e);
}
+ ReceiveSharingIntent.clearFileNames();
if (!_data) {
return;
}
diff --git a/apps/mobile/src/views/Editor/Functions.js b/apps/mobile/src/views/Editor/Functions.js
index 8a1490d8f..c2caa77be 100644
--- a/apps/mobile/src/views/Editor/Functions.js
+++ b/apps/mobile/src/views/Editor/Functions.js
@@ -315,6 +315,8 @@ async function setNoteInEditorAfterSaving(oldId, currentId) {
}
setTimeout(() => {
post('title', note.title);
+ post('dateEdited', timeConverter(note.dateEdited));
+ post('saving', 'Saved');
}, 150);
}
}