A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fix: crash on notebooks & other related views (fixes streetwriters/notesnook#504, streetwriters/notesnook#512, streetwriters/notesnook#513)
thecodrrca393b194329
diff --git a/apps/web/src/components/dialogs/move-note-dialog.js b/apps/web/src/components/dialogs/move-note-dialog.jsindex fe15e1a52..17bdae8a2 100644--- a/apps/web/src/components/dialogs/move-note-dialog.js+++ b/apps/web/src/components/dialogs/move-note-dialog.js@@ -9,6 +9,7 @@ import { store as notestore } from "../../stores/note-store";import { useStore, store } from "../../stores/notebook-store";import { getTotalNotes } from "../../common";import Accordion from "../accordion";+import { pluralize } from "../../utils/string";function MoveDialog({ onClose, noteIds }) {const [selected, setSelected] = useState([]);@@ -139,7 +140,7 @@ function MoveDialog({ onClose, noteIds }) {indent={1}icon={Icon.Topic}title={topic.title}- totalNotes={topic.notes.length}+ totalNotes={topic.notes?.length || 0}action={isSelected && hasNotes ? (<Icon.Close@@ -175,7 +176,7 @@ function MoveDialog({ onClose, noteIds }) {}function topicHasNotes(topic, noteIds) {- return noteIds.some((id) => topic.notes.indexOf(id) > -1);+ return noteIds.some((id) => topic.notes && topic.notes.indexOf(id) > -1);}function FilteredList({@@ -292,7 +293,7 @@ function Item(props) {><Flex flexDirection="column"><Text variant="body">{title}</Text>- <Text variant="subBody">{totalNotes + " notes"}</Text>+ <Text variant="subBody">{pluralize(totalNotes, "note", "notes")}</Text></Flex>{action}</Button>diff --git a/apps/web/src/components/topic/index.js b/apps/web/src/components/topic/index.jsindex 0c27905b6..9af6537c0 100644--- a/apps/web/src/components/topic/index.js+++ b/apps/web/src/components/topic/index.js@@ -1,7 +1,6 @@import React from "react";import ListItem from "../list-item";import { db } from "../../common/db";-import { store } from "../../stores/notebook-store";import { store as appStore } from "../../stores/app-store";import { hashNavigate } from "../../navigation";import { Flex, Text } from "rebass";@@ -29,7 +28,7 @@ function Topic({ item, index, onClick }) {•</Text><Text variant="subBody">- {pluralize(topic.notes.length, "note", "notes")}+ {pluralize(topic.notes?.length || 0, "note", "notes")}</Text></Flex>}