Skip to content

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

fix state updating

Ammar Ahmed7703988bd0a1
diff --git a/apps/mobile/src/services/navigation.ts b/apps/mobile/src/services/navigation.ts
index 0e90c9336..3ba40a78f 100755
--- a/apps/mobile/src/services/navigation.ts
+++ b/apps/mobile/src/services/navigation.ts
@@ -120,15 +120,15 @@ function routeNeedsUpdate(routeName: Route, callback: () => void) {
function queueRoutesForUpdate(...routes: Route[]) {
console.log('updating routes', routes);
const currentScreen = useNavigationStore.getState().currentScreen;
- const routeHistory = rootNavigatorRef.current?.getRootState()?.routes || [
- { key: currentScreen.name }
- ];
+ // const routeHistory = rootNavigatorRef.current?.getRootState()?.routes || [
+ // { key: currentScreen.name }
+ // ];
// filter out routes that are not rendered to prevent unnecessary updates
- routes = routes.filter(
- //@ts-ignore
- routeName => routeHistory?.findIndex(route => route.key?.startsWith(routeName)) > -1
- );
+ // routes = routes.filter(
+ // //@ts-ignore
+ // routeName => routeHistory?.findIndex(route => route.key?.startsWith(routeName)) > -1
+ // );
if (routes.indexOf(currentScreen.name) > -1) {
console.log('updating current route');
@@ -141,7 +141,7 @@ function queueRoutesForUpdate(...routes: Route[]) {
routesUpdateQueue = routesUpdateQueue.concat(routes);
routesUpdateQueue = [...new Set(routesUpdateQueue)];
- console.log(routesUpdateQueue);
+ //console.log(routesUpdateQueue);
}
function navigate<T extends RouteName>(screen: CurrentScreen, params: RouteParams[T]) {
diff --git a/apps/mobile/src/stores/useNotesStore.ts b/apps/mobile/src/stores/useNotesStore.ts
index 475d61178..8b73ca869 100644
--- a/apps/mobile/src/stores/useNotesStore.ts
+++ b/apps/mobile/src/stores/useNotesStore.ts
@@ -18,7 +18,6 @@ export const useNoteStore = create<NoteStore>((set, get) => ({
setLoading: loading => set({ loading: loading }),
setNotes: items => {
- console.log('UPDATING NOTES');
if (!items) {
set({
notes: groupArray((db.notes?.all as NoteType[]) || [], db.settings?.getGroupOptions('home'))