Skip to content

Commit 381ff8b

Browse files
committed
fix(mobile): exclude deleted and archived notes from folder and all views
1 parent 4e00657 commit 381ff8b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

apps/mobile/v1/src/screens/NotesListScreen.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default function NotesListScreen({ navigation, route, renderHeader, scrol
122122
return () => clearTimeout(timer);
123123
}, [loading]);
124124

125-
// Load notes when screen focuses
125+
// Load notes when screen focuses or params change
126126
useFocusEffect(
127127
React.useCallback(() => {
128128
loadNotes();
@@ -132,7 +132,7 @@ export default function NotesListScreen({ navigation, route, renderHeader, scrol
132132
scrollViewRef.current.scrollTo({ y: 0, animated: false });
133133
}
134134
// eslint-disable-next-line react-hooks/exhaustive-deps
135-
}, [])
135+
}, [folderId, viewType, searchQuery])
136136
);
137137

138138
const loadViewMode = async () => {
@@ -167,6 +167,14 @@ export default function NotesListScreen({ navigation, route, renderHeader, scrol
167167
queryParams.archived = true;
168168
} else if (viewType === 'trash') {
169169
queryParams.deleted = true;
170+
} else if (viewType === 'all') {
171+
// For 'all' view, exclude deleted and archived
172+
queryParams.deleted = false;
173+
queryParams.archived = false;
174+
} else if (folderId) {
175+
// For regular folder view (no viewType), exclude deleted and archived
176+
queryParams.deleted = false;
177+
queryParams.archived = false;
170178
}
171179

172180
// Fetch notes with server-side filtering (much faster!)

0 commit comments

Comments
 (0)