Skip to content

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

optimize screen loading

ammarahm-ed597f5417c1b6
diff --git a/apps/mobile/src/components/SimpleList/index.js b/apps/mobile/src/components/SimpleList/index.js
index dbd23c31d..7e538ddbc 100644
--- a/apps/mobile/src/components/SimpleList/index.js
+++ b/apps/mobile/src/components/SimpleList/index.js
@@ -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) {
diff --git a/apps/mobile/src/utils/index.js b/apps/mobile/src/utils/index.js
index 7e6a1034d..55d9ce000 100755
--- a/apps/mobile/src/utils/index.js
+++ b/apps/mobile/src/utils/index.js
@@ -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;
diff --git a/apps/mobile/src/views/Notebook/index.js b/apps/mobile/src/views/Notebook/index.js
index 3ab456ae0..77b638570 100644
--- a/apps/mobile/src/views/Notebook/index.js
+++ b/apps/mobile/src/views/Notebook/index.js
@@ -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;
diff --git a/apps/mobile/src/views/Notes/index.js b/apps/mobile/src/views/Notes/index.js
index bdacbccc1..4957df011 100644
--- a/apps/mobile/src/views/Notes/index.js
+++ b/apps/mobile/src/views/Notes/index.js
@@ -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();