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 crash
ammarahm-ed5bf59664fa62
diff --git a/apps/mobile/src/components/NotesList/index.js b/apps/mobile/src/components/NotesList/index.jsindex cd96165a9..1b31fde51 100644--- a/apps/mobile/src/components/NotesList/index.js+++ b/apps/mobile/src/components/NotesList/index.js@@ -15,13 +15,16 @@ import {NotesPlaceHolder} from '../ListPlaceholders';import NoteItem from '../NoteItem';import SelectionWrapper from '../SelectionWrapper';-export const NotesList = ({- isSearch = false,- isGrouped = false,- searchResults,-}) => {+export const NotesList = ({isGrouped = false}) => {const [state, dispatch] = useTracked();- const {colors, selectionMode, currentEditingNote, loading} = state;+ const {+ colors,+ selectionMode,+ currentEditingNote,+ loading,+ searchResults,+ keyword,+ } = state;const notes = [...state.notes];const _renderItem = ({item, index}) => (@@ -165,7 +168,7 @@ export const NotesList = ({const _listKeyExtractor = (item, index) => item.dateCreated.toString();- return isGrouped && !isSearch ? (+ return isGrouped && searchResults.length === 0 ? (<SectionListref={ref => (sectionListRef = ref)}sections={notes}diff --git a/apps/mobile/src/provider/defaultState.js b/apps/mobile/src/provider/defaultState.jsindex 13c9c03da..6ebb53d06 100644--- a/apps/mobile/src/provider/defaultState.js+++ b/apps/mobile/src/provider/defaultState.js@@ -33,4 +33,6 @@ export const defaultState = {isLoginNavigator: false,currenEditingNote: null,loading: true,+ searchResults: [],+ keyword: [],};diff --git a/apps/mobile/src/views/Editor/index.js b/apps/mobile/src/views/Editor/index.jsindex ea1a01610..47f91b12f 100755--- a/apps/mobile/src/views/Editor/index.js+++ b/apps/mobile/src/views/Editor/index.js@@ -421,8 +421,8 @@ const Editor = ({navigation, noMenu}) => {Platform.OS === 'ios'? sourceUri: {- uri: 'http://192.168.10.7:8080/texteditor.html',- baseUrl: 'http://192.168.10.7:8080',+ uri: 'file:///android_asset/texteditor.html',+ baseUrl: 'file:///android_asset/',}}style={{diff --git a/apps/mobile/src/views/Home/index.js b/apps/mobile/src/views/Home/index.jsindex e47abe440..6e81e8aed 100755--- a/apps/mobile/src/views/Home/index.js+++ b/apps/mobile/src/views/Home/index.js@@ -16,19 +16,15 @@ export const AnimatedSafeAreaView = Animatable.createAnimatableComponent();export const Home = ({navigation}) => {- // Stateconst [state, dispatch] = useTracked();- const {notes, searchResults, keyword} = state;- const isFocused = useIsFocused();+ const {notes} = state;- // Effects+ const isFocused = useIsFocused();useEffect(() => {dispatch({type: ACTIONS.NOTES});}, [isFocused]);- // Render-return (<ContainerbottomButtonText="Add a new note"@@ -41,13 +37,8 @@ export const Home = ({navigation}) => {NavigationService.navigate('Editor');}}}- data={notes}>- <NotesList- isGrouped={true}- isSearch={searchResults.length > 0 ? true : false}- searchResults={searchResults.length > 0 ? searchResults : null}- keyword={keyword}- />+ data={notes ? notes : []}>+ <NotesList isGrouped={true} /></Container>);};