mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
optimize screen loading
This commit is contained in:
@@ -6,6 +6,8 @@ import {DataProvider, LayoutProvider, RecyclerListView} from 'recyclerlistview';
|
||||
import {useTracked} from '../../provider';
|
||||
import {DDS} from '../../services/DeviceDetection';
|
||||
import {eSendEvent} from '../../services/EventManager';
|
||||
import Navigation from '../../services/Navigation';
|
||||
import SettingsService from '../../services/SettingsService';
|
||||
import Sync from '../../services/Sync';
|
||||
import {dHeight} from '../../utils';
|
||||
import {eScrollEvent} from '../../utils/Events';
|
||||
@@ -69,14 +71,10 @@ const SimpleList = ({
|
||||
setLoading(false);
|
||||
setTimeout(() => {
|
||||
setLoaded(true)
|
||||
},50);
|
||||
},Navigation.getCurrentScreen() === SettingsService.get().homepage ? 1000 : 150);
|
||||
}
|
||||
}, [listData, deviceMode, loading]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("rerendering");
|
||||
})
|
||||
|
||||
const _onRefresh = async () => {
|
||||
await Sync.run();
|
||||
if (refreshCallback) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import {tabBarRef} from './Refs';
|
||||
import {SIZE} from './SizeUtils';
|
||||
|
||||
export const InteractionManager = {
|
||||
runAfterInteractions: (func, time = 150) => setTimeout(func, time),
|
||||
runAfterInteractions: (func, time = 10) => setTimeout(func, time),
|
||||
};
|
||||
|
||||
export const APP_VERSION = 1350;
|
||||
|
||||
@@ -26,7 +26,7 @@ export const Notebook = ({route, navigation}) => {
|
||||
|
||||
let ranAfterInteractions = false;
|
||||
|
||||
const runAfterInteractions = (time = 150) => {
|
||||
const runAfterInteractions = (time = 10) => {
|
||||
InteractionManager.runAfterInteractions(() => {
|
||||
let notebook = db.notebooks.notebook(params.notebook?.id).data;
|
||||
params.notebook = notebook;
|
||||
|
||||
@@ -32,7 +32,7 @@ export const Notes = ({route, navigation}) => {
|
||||
let pageIsLoaded = false;
|
||||
let ranAfterInteractions = false;
|
||||
|
||||
const runAfterInteractions = (time = 150) => {
|
||||
const runAfterInteractions = (time = 10) => {
|
||||
InteractionManager.runAfterInteractions(() => {
|
||||
Navigation.routeNeedsUpdate('NotesPage', () => {
|
||||
init();
|
||||
|
||||
Reference in New Issue
Block a user