Skip to content

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

update notes-core

ammarahm-edf55c34d6ce43
diff --git a/apps/mobile/App.js b/apps/mobile/App.js
index 566f81930..863dad323 100644
--- a/apps/mobile/App.js
+++ b/apps/mobile/App.js
@@ -242,8 +242,10 @@ const App = () => {
}, []);
const loadMainApp = () => {
+ console.log('main app loadinggggg');
dispatch({type: Actions.ALL});
AppRootView = require('./initializer.root').RootView;
+ sleep(100).then(() => SplashScreen.hide());
getUser().then(console.log).catch(console.log);
backupData().then((r) => r);
sleep(500).then(() => (appInit = true));
@@ -286,6 +288,7 @@ const App = () => {
}, []);
const runAfterInit = () => {
+ let isIntent = false;
IntentService.getIntent()
.then(() => {
AppRootView = require('./initializer.intent').IntentView;
@@ -294,13 +297,17 @@ const App = () => {
intentInit = true;
dispatch({type: Actions.ALL});
setIntent(true);
+ isIntent = true;
ReceiveSharingIntent.clearFileNames();
})
- .catch((e) => {
- console.log(e, 'no intent recieved');
- ReceiveSharingIntent.clearFileNames();
- intentInit = true;
- loadMainApp();
+ .catch((e) => console.log)
+ .finally(() => {
+ if (!isIntent) {
+ console.log('no intent recieved');
+ ReceiveSharingIntent.clearFileNames();
+ intentInit = true;
+ loadMainApp();
+ }
});
};
diff --git a/apps/mobile/initializer.root.js b/apps/mobile/initializer.root.js
index 21abec8f1..29538b981 100644
--- a/apps/mobile/initializer.root.js
+++ b/apps/mobile/initializer.root.js
@@ -19,6 +19,7 @@ import {
eSubscribeEvent,
eUnSubscribeEvent,
} from './src/services/EventManager';
+import IntentService from './src/services/IntentService';
import SettingsService from './src/services/SettingsService';
import {editing, setWidthHeight} from './src/utils';
import {
@@ -196,10 +197,6 @@ const AppStack = React.memo(
} else {
setDeviceMode('mobile', size);
}
- if (!SettingsService.getApploaded()) {
- eSendEvent('nointent');
- }
- sleep(100).then(() => SplashScreen.hide() )
}
function setDeviceMode(current, size) {
diff --git a/apps/mobile/src/components/SimpleList/index.js b/apps/mobile/src/components/SimpleList/index.js
index 7aa949482..adbd6b5aa 100644
--- a/apps/mobile/src/components/SimpleList/index.js
+++ b/apps/mobile/src/components/SimpleList/index.js
@@ -21,7 +21,7 @@ import {
eScrollEvent,
} from '../../utils/Events';
import {SIZE} from '../../utils/SizeUtils';
-import { sleep } from '../../utils/TimeUtils';
+import {sleep} from '../../utils/TimeUtils';
import {Button} from '../Button';
import {HeaderMenu} from '../Header/HeaderMenu';
import Seperator from '../Seperator';
@@ -49,7 +49,7 @@ const SimpleList = ({
loading,
}) => {
const [state, dispatch] = useTracked();
- const {colors,searchResults} = state;
+ const {colors, searchResults} = state;
const [refreshing, setRefreshing] = useState(false);
const [dataProvider, setDataProvider] = useState(
new DataProvider((r1, r2) => {
@@ -73,12 +73,9 @@ const SimpleList = ({
}, [listData, searchResults.results]);
const loadData = () => {
- sleep(500).then(()=> {
- let mainData = [header, {type: 'empty'}];
- mainData =
- !listData || listData.length === 0 ? mainData : [header, ...listData];
- setDataProvider(dataProvider.cloneWithRows(mainData));
- })
+ if (listData || listData.length === 0) {
+ setDataProvider(dataProvider.cloneWithRows([header, ...listData]));
+ }
};
const RenderSectionHeader = ({item, index}) => (