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 = () => {
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();
}
});
};

View File

@@ -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) {

View File

@@ -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}) => (