mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-08-29 10:09:26 +02:00
mobile: fix error on android's search query (#10106)
* mobile: pass value for items when searching on main screen to match other screens' pattern Signed-off-by: Suyadi <afsuyadi@gmail.com> * core: guard notesWithHighlighting against an undefined notes selector. Signed-off-by: Suyadi <afsuyadi@gmail.com> * core: add regression test for notesWithHighlighting crash. Signed-off-by: Suyadi <afsuyadi@gmail.com> * core: revert changes after feedback Signed-off-by: Suyadi <afsuyadi@gmail.com> * mobile: ensure type: "note" will make items become mandatory. Signed-off-by: Suyadi <afsuyadi@gmail.com> * core: remove tests after feedback Signed-off-by: Suyadi <afsuyadi@gmail.com>
This commit is contained in:
@@ -30,6 +30,7 @@ import SettingsService from "../../services/settings";
|
||||
import useNavigationStore from "../../stores/use-navigation-store";
|
||||
import { useNotes } from "../../stores/use-notes-store";
|
||||
import { openEditor } from "../notes/common";
|
||||
import { db } from "../../common/database";
|
||||
|
||||
export const Home = ({ navigation, route }: NavigationProps<"Notes">) => {
|
||||
const [notes, loading] = useNotes();
|
||||
@@ -59,7 +60,8 @@ export const Home = ({ navigation, route }: NavigationProps<"Notes">) => {
|
||||
placeholder: strings.searchInRoute(route.name),
|
||||
type: "note",
|
||||
title: route.name,
|
||||
route: route.name
|
||||
route: route.name,
|
||||
items: db.notes.all
|
||||
});
|
||||
}}
|
||||
id={route.name}
|
||||
|
||||
@@ -74,13 +74,21 @@ export interface RouteParams extends ParamListBase {
|
||||
Tags: GenericRouteParam;
|
||||
Favorites: GenericRouteParam;
|
||||
Trash: GenericRouteParam;
|
||||
Search: {
|
||||
placeholder: string;
|
||||
type: ItemType;
|
||||
title: string;
|
||||
route: RouteName;
|
||||
items?: FilteredSelector<Item>;
|
||||
};
|
||||
Search:
|
||||
| {
|
||||
placeholder: string;
|
||||
type: "note";
|
||||
title: string;
|
||||
route: RouteName;
|
||||
items: FilteredSelector<Note>;
|
||||
}
|
||||
| {
|
||||
placeholder: string;
|
||||
type: Exclude<ItemType, "note">;
|
||||
title: string;
|
||||
route: RouteName;
|
||||
items?: FilteredSelector<Item>;
|
||||
};
|
||||
TaggedNotes: NotesScreenParams;
|
||||
ColoredNotes: NotesScreenParams;
|
||||
TopicNotes: NotesScreenParams;
|
||||
|
||||
Reference in New Issue
Block a user