update notes-core

This commit is contained in:
ammarahm-ed
2020-12-07 16:04:22 +05:00
parent b106c7f147
commit f55c34d6ce
3 changed files with 18 additions and 17 deletions

View File

@@ -242,8 +242,10 @@ const App = () => {
}, []); }, []);
const loadMainApp = () => { const loadMainApp = () => {
console.log('main app loadinggggg');
dispatch({type: Actions.ALL}); dispatch({type: Actions.ALL});
AppRootView = require('./initializer.root').RootView; AppRootView = require('./initializer.root').RootView;
sleep(100).then(() => SplashScreen.hide());
getUser().then(console.log).catch(console.log); getUser().then(console.log).catch(console.log);
backupData().then((r) => r); backupData().then((r) => r);
sleep(500).then(() => (appInit = true)); sleep(500).then(() => (appInit = true));
@@ -286,6 +288,7 @@ const App = () => {
}, []); }, []);
const runAfterInit = () => { const runAfterInit = () => {
let isIntent = false;
IntentService.getIntent() IntentService.getIntent()
.then(() => { .then(() => {
AppRootView = require('./initializer.intent').IntentView; AppRootView = require('./initializer.intent').IntentView;
@@ -294,13 +297,17 @@ const App = () => {
intentInit = true; intentInit = true;
dispatch({type: Actions.ALL}); dispatch({type: Actions.ALL});
setIntent(true); setIntent(true);
isIntent = true;
ReceiveSharingIntent.clearFileNames(); ReceiveSharingIntent.clearFileNames();
}) })
.catch((e) => { .catch((e) => console.log)
console.log(e, 'no intent recieved'); .finally(() => {
if (!isIntent) {
console.log('no intent recieved');
ReceiveSharingIntent.clearFileNames(); ReceiveSharingIntent.clearFileNames();
intentInit = true; intentInit = true;
loadMainApp(); loadMainApp();
}
}); });
}; };

View File

@@ -19,6 +19,7 @@ import {
eSubscribeEvent, eSubscribeEvent,
eUnSubscribeEvent, eUnSubscribeEvent,
} from './src/services/EventManager'; } from './src/services/EventManager';
import IntentService from './src/services/IntentService';
import SettingsService from './src/services/SettingsService'; import SettingsService from './src/services/SettingsService';
import {editing, setWidthHeight} from './src/utils'; import {editing, setWidthHeight} from './src/utils';
import { import {
@@ -196,10 +197,6 @@ const AppStack = React.memo(
} else { } else {
setDeviceMode('mobile', size); setDeviceMode('mobile', size);
} }
if (!SettingsService.getApploaded()) {
eSendEvent('nointent');
}
sleep(100).then(() => SplashScreen.hide() )
} }
function setDeviceMode(current, size) { function setDeviceMode(current, size) {

View File

@@ -21,7 +21,7 @@ import {
eScrollEvent, eScrollEvent,
} from '../../utils/Events'; } from '../../utils/Events';
import {SIZE} from '../../utils/SizeUtils'; import {SIZE} from '../../utils/SizeUtils';
import { sleep } from '../../utils/TimeUtils'; import {sleep} from '../../utils/TimeUtils';
import {Button} from '../Button'; import {Button} from '../Button';
import {HeaderMenu} from '../Header/HeaderMenu'; import {HeaderMenu} from '../Header/HeaderMenu';
import Seperator from '../Seperator'; import Seperator from '../Seperator';
@@ -49,7 +49,7 @@ const SimpleList = ({
loading, loading,
}) => { }) => {
const [state, dispatch] = useTracked(); const [state, dispatch] = useTracked();
const {colors,searchResults} = state; const {colors, searchResults} = state;
const [refreshing, setRefreshing] = useState(false); const [refreshing, setRefreshing] = useState(false);
const [dataProvider, setDataProvider] = useState( const [dataProvider, setDataProvider] = useState(
new DataProvider((r1, r2) => { new DataProvider((r1, r2) => {
@@ -73,12 +73,9 @@ const SimpleList = ({
}, [listData, searchResults.results]); }, [listData, searchResults.results]);
const loadData = () => { const loadData = () => {
sleep(500).then(()=> { if (listData || listData.length === 0) {
let mainData = [header, {type: 'empty'}]; setDataProvider(dataProvider.cloneWithRows([header, ...listData]));
mainData = }
!listData || listData.length === 0 ? mainData : [header, ...listData];
setDataProvider(dataProvider.cloneWithRows(mainData));
})
}; };
const RenderSectionHeader = ({item, index}) => ( const RenderSectionHeader = ({item, index}) => (