A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fix webview destroyed after opening share extension
ammarahm-eda2c3bd76b750
diff --git a/apps/mobile/share/index.js b/apps/mobile/share/index.jsindex 6c8cf9a44..a70eed804 100644--- a/apps/mobile/share/index.js+++ b/apps/mobile/share/index.js@@ -230,10 +230,14 @@ const NotesnookShare = ({quicknote = false}) => {};useEffect(() => {+ console.log('setting value in storage');loadData();useShareStore.getState().restoreAppendNote();sleep(50).then(() => {animate(1, 0);+ sleep(500).then(r => {+ Storage.write('shareExtensionOpened',"opened");+ });});}, []);diff --git a/apps/mobile/src/utils/useAppEvents.js b/apps/mobile/src/utils/useAppEvents.jsindex 823e6230d..3fa3611d5 100644--- a/apps/mobile/src/utils/useAppEvents.js+++ b/apps/mobile/src/utils/useAppEvents.js@@ -464,6 +464,7 @@ export const useAppEvents = () => {}}refValues.current.prevState = 'active';+ console.log(state,"SETTING VALUE");await reconnectSSE();await checkIntentState();if (getWebviewInit()) {@@ -541,20 +542,26 @@ export const useAppEvents = () => {async function checkIntentState() {try {- let intent = await MMKV.getItem('notesAddedFromIntent');- if (intent) {+ let notesAddedFromIntent = await MMKV.getItem('notesAddedFromIntent');+ let shareExtensionOpened = await MMKV.getItem('shareExtensionOpened');+ if (notesAddedFromIntent) {if (Platform.OS === 'ios') {await db.init();await db.notes.init();}- eSendEvent('webviewreset');useNoteStore.getState().setNotes();eSendEvent(refreshNotesPage);MMKV.removeItem('notesAddedFromIntent');initialize();eSendEvent(refreshNotesPage);}- } catch (e) {}+ if (notesAddedFromIntent || shareExtensionOpened) {+ eSendEvent('webviewreset');+ MMKV.removeItem('shareExtensionOpened');+ }+ } catch (e) {+ console.log(e);+ }}return true;