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 storage
ammarahm-ed86a1dfd61094
diff --git a/apps/mobile/src/utils/storage.js b/apps/mobile/src/utils/storage.jsindex d4721b89c..149c2611b 100644--- a/apps/mobile/src/utils/storage.js+++ b/apps/mobile/src/utils/storage.js@@ -3,18 +3,21 @@ import FastStorage, {getArray, setArray} from 'react-native-fast-storage';var Aes = NativeModules.Aes;-async function read(key, isArray) {+async function read(key, isArray = false) {let data;if (isArray) {data = await getArray(key);+ data.push('hello');} else {data = await FastStorage.getMap(key);}- return !data ? undefined : data;+ console.log('READ', data, key);+ return data;}async function write(key, data) {- if (Array.isArray(data)) {+ if (data.length !== undefined) {+ console.log(data, key);return await setArray(key, data);} else {return await FastStorage.setMap(key, data);@@ -25,7 +28,7 @@ async function readMulti(keys) {if (keys.length <= 0) {return [];} else {- let data = await FastStorage.getMultipleItems(keys);+ let data = await FastStorage.getMultipleItems(keys.slice());return !data ? undefined : data;}}diff --git a/apps/mobile/src/views/Editor/index.js b/apps/mobile/src/views/Editor/index.jsindex f6885f0ea..e7589ebd7 100755--- a/apps/mobile/src/views/Editor/index.js+++ b/apps/mobile/src/views/Editor/index.js@@ -110,6 +110,7 @@ const Editor = ({navigation, noMenu}) => {const clearEditor = async () => {await saveNote(true);+setDateEdited(0);title = null;content = null;@@ -164,8 +165,7 @@ const Editor = ({navigation, noMenu}) => {const saveNote = async (lockNote = true) => {if (!title && !content) return;- if (title === '' && content.text === '') return;-+ if (title.trim().length === 0 && content.text.trim().length === 0) return;if (!content) {content = {text: '',@@ -173,6 +173,7 @@ const Editor = ({navigation, noMenu}) => {};}+ console.log(id, title, content);let rId = await db.notes.add({title,content: {@@ -221,8 +222,6 @@ const Editor = ({navigation, noMenu}) => {break;}case 'color': {- console.log('I WORKED');-await db.notes.note(id).color(editing.actionAfterFirstSave.id);editing.actionAfterFirstSave = {