Skip to content

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

mobile: fix cannot read property of title (#1921)

Ammar Ahmed2a2811ec5417
diff --git a/apps/mobile/app/screens/notes/common.ts b/apps/mobile/app/screens/notes/common.ts
index 038f69187..9441d70c5 100644
--- a/apps/mobile/app/screens/notes/common.ts
+++ b/apps/mobile/app/screens/notes/common.ts
@@ -31,13 +31,14 @@ import { TopicType } from "../../utils/types";
import { editorController, editorState } from "../editor/tiptap/utils";
export function toCamelCase(title: string) {
+ if (!title) return "";
return title.slice(0, 1).toUpperCase() + title.slice(1);
}
export function getAlias(params: Partial<NotesScreenParams>) {
if (!params) return "";
const { item } = params;
- return (item as TopicType)?.alias || item?.title;
+ return (item as TopicType)?.alias || item?.title || "";
}
export function openMonographsWebpage() {