mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
mobile: exit current topic if it is deleted.
This commit is contained in:
committed by
Abdullah Atta
parent
234e368c4d
commit
fb56e7c866
@@ -181,8 +181,9 @@ const NotesPage = ({
|
||||
if (isNew) setLoadingNotes(true);
|
||||
const notes = get(params.current, true) as NoteType[];
|
||||
if (
|
||||
(item.type === "tag" || item.type === "color") &&
|
||||
(!notes || notes.length === 0)
|
||||
((item.type === "tag" || item.type === "color") &&
|
||||
(!notes || notes.length === 0)) ||
|
||||
(item.type === "topic" && !notes)
|
||||
) {
|
||||
return Navigation.goBack();
|
||||
}
|
||||
|
||||
@@ -75,7 +75,11 @@ export const TopicNotes = ({
|
||||
|
||||
TopicNotes.get = (params: NotesScreenParams, grouped = true) => {
|
||||
const { id, notebookId } = params.item as TopicType;
|
||||
const notes = db.notebooks?.notebook(notebookId)?.topics.topic(id)?.all || [];
|
||||
const topic = db.notebooks?.notebook(notebookId)?.topics.topic(id);
|
||||
if (!topic) {
|
||||
return null;
|
||||
}
|
||||
const notes = topic?.all || [];
|
||||
return grouped
|
||||
? groupArray(notes, db.settings?.getGroupOptions("notes"))
|
||||
: notes;
|
||||
|
||||
Reference in New Issue
Block a user