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
do not load previous app state if note was null
ammarahm-ed2a45c846fbc7
diff --git a/apps/mobile/src/components/SimpleList/index.js b/apps/mobile/src/components/SimpleList/index.jsindex 1bec20e27..94e4aff10 100644--- a/apps/mobile/src/components/SimpleList/index.js+++ b/apps/mobile/src/components/SimpleList/index.js@@ -72,12 +72,10 @@ const SimpleList = ({const loadData = () => {let mainData = [header, {type: 'empty'}];- console.log(mainData);mainData =!listData || listData.length === 0? mainData: [header, ...listData];- console.log(mainData,'main data');setDataProvider(dataProvider.cloneWithRows(mainData));};diff --git a/apps/mobile/src/provider/DefaultState.js b/apps/mobile/src/provider/DefaultState.jsindex 4d4a0672f..1ef3017e3 100644--- a/apps/mobile/src/provider/DefaultState.js+++ b/apps/mobile/src/provider/DefaultState.js@@ -17,7 +17,7 @@ export const defaultState = {colorNotes: [],user: null,fullscreen:false,- premiumUser: true,+ premiumUser: false,settings: {showToolbarOnTop: false,showKeyboardOnOpen: false,diff --git a/apps/mobile/src/views/Editor/EditorWrapper.js b/apps/mobile/src/views/Editor/EditorWrapper.jsindex 524bfef12..1e2d10005 100644--- a/apps/mobile/src/views/Editor/EditorWrapper.js+++ b/apps/mobile/src/views/Editor/EditorWrapper.js@@ -10,6 +10,7 @@ import {eOnLoadNote} from '../../utils/Events';import Editor from './index';import {editorRef} from '../../utils/Refs';import {DDS} from '../../services/DeviceDetection';+import {GetPremium} from '../../components/ActionSheetComponent/GetPremium';let prevVal = 0;let finalValue = 80;let anim2 = new Animated.Value(0);@@ -94,6 +95,7 @@ export const EditorWrapper = ({dimensions}) => {height: '100%',backgroundColor: colors.bg,}}>+ <GetPremium context="editor" offset={50 + insets.top} /><Viewstyle={{position: 'absolute',diff --git a/apps/mobile/src/views/Editor/Functions.js b/apps/mobile/src/views/Editor/Functions.jsindex 6170b15f6..7508064e3 100644--- a/apps/mobile/src/views/Editor/Functions.js+++ b/apps/mobile/src/views/Editor/Functions.js@@ -1,20 +1,25 @@-import { createRef } from 'react';-import { Linking, Platform } from 'react-native';+import {createRef} from 'react';+import {Linking, Platform} from 'react-native';import SplashScreen from 'react-native-splash-screen';-import { updateEvent } from '../../components/DialogManager/recievers';-import { Actions } from '../../provider/Actions';-import { DDS } from '../../services/DeviceDetection';-import { eSendEvent, sendNoteEditedEvent } from '../../services/EventManager';+import {updateEvent} from '../../components/DialogManager/recievers';+import {Actions} from '../../provider/Actions';+import {DDS} from '../../services/DeviceDetection';+import {eSendEvent, sendNoteEditedEvent} from '../../services/EventManager';import IntentService from '../../services/IntentService';-import { editing } from '../../utils';-import { COLORS_NOTE, COLOR_SCHEME } from '../../utils/Colors';-import { hexToRGBA } from '../../utils/ColorUtils';-import { db } from '../../utils/DB';-import { eOnLoadNote, refreshNotesPage } from '../../utils/Events';-import { MMKV } from '../../utils/mmkv';-import { sideMenuRef, tabBarRef } from '../../utils/Refs';-import { normalize } from '../../utils/SizeUtils';-import { sleep, timeConverter } from '../../utils/TimeUtils';+import {editing} from '../../utils';+import {COLORS_NOTE, COLOR_SCHEME} from '../../utils/Colors';+import {hexToRGBA} from '../../utils/ColorUtils';+import {db} from '../../utils/DB';+import {+ eOnLoadNote,+ eOpenPremiumDialog,+ eShowGetPremium,+ refreshNotesPage,+} from '../../utils/Events';+import {MMKV} from '../../utils/mmkv';+import {sideMenuRef, tabBarRef} from '../../utils/Refs';+import {normalize} from '../../utils/SizeUtils';+import {sleep, timeConverter} from '../../utils/TimeUtils';export const EditorWebView = createRef();@@ -225,6 +230,15 @@ export const _onMessage = async (evt) => {break;case 'scroll':eSendEvent('editorScroll', message);+ break;+ case 'premium':+ post('blur');+ eSendEvent(eShowGetPremium, {+ context: 'editor',+ title: 'Get Notesnook Pro',+ desc: 'Enjoy Full Rich Text Editor with Markdown Support!',+ });+break;default:break;@@ -386,10 +400,8 @@ export async function onWebViewLoad(premium, colors, event) {webviewInit = true;}async function loadEditorState() {- console.log('here stuck')if (sideMenuRef.current !== null) {if (intent) {- console.log('clearing here');MMKV.removeItem('appState');return;}@@ -397,8 +409,8 @@ async function loadEditorState() {console.log('checking for app state', appState);if (appState) {appState = JSON.parse(appState);- if (appState.editing && appState.note.id !== null) {- console.log('loading in editor');+ if (appState.editing && appState.note && appState.note.id) {+ console.log("loading note in editor")eSendEvent(eOnLoadNote, appState.note);tabBarRef.current?.goToPage(1);MMKV.removeItem('appState');@@ -406,10 +418,10 @@ async function loadEditorState() {}} else {// Checks intent only when app is loading- console.log('here checking for intent and waiting')+ console.log('here checking for intent and waiting');IntentService.check((event) => {if (event) {- console.log('I am handling the intent')+ console.log('I am handling the intent');intent = true;eSendEvent(eOnLoadNote, event);SplashScreen.hide();