Skip to content

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

Merge branch 'move-pins-out'

Abdullah Atta6c613c6f1ede
diff --cc apps/web/src/components/navigation-menu/index.tsx
index 5b8fa760d,6ff0df88e..359480f13
--- a/apps/web/src/components/navigation-menu/index.tsx
+++ b/apps/web/src/components/navigation-menu/index.tsx
@@@ -203,25 -188,28 +203,25 @@@ function NavigationMenu(props: Navigati
my={1}
sx={{ width: "85%", height: "0.8px", alignSelf: "center" }}
/>
- {pins.map((pin) => (
+ {shortcuts.map((item) => (
<NavigationItem
isTablet={isTablet}
- key={pin.id}
- title={pin.type === "tag" ? db.tags?.alias(pin.id) : pin.title}
+ key={item.id}
- title={item.type === "tag" ? db.tags.alias(item.id) : item.title}
- menu={{
- items: [
- {
- key: "removeshortcut",
- title: () => "Remove shortcut",
- onClick: async ({ item }) => {
- await db.shortcuts.remove(item.id);
- refreshNavItems();
- }
++ title={item.type === "tag" ? db.tags?.alias(item.id) : item.title}
+ menuItems={[
+ {
- key: "remove-shortcut",
++ key: "removeshortcut",
+ title: () => "Remove shortcut",
- onClick: async () => {
- await db.settings?.unpin(pin.id);
++ onClick: async ({ item }: { item: { id: string } }) => {
++ await db.shortcuts?.remove(item.id);
+ refreshNavItems();
}
- ],
- extraData: { item }
- }}
+ }
+ ]}
icon={
- pin.type === "notebook"
+ item.type === "notebook"
? Notebook2
- : pin.type === "tag"
+ : item.type === "tag"
? Tag2
: Topic
}
diff --cc packages/core/collections/notebooks.js
index effcc797f,1e00465c9..19b95dc38
--- a/packages/core/collections/notebooks.js
+++ b/packages/core/collections/notebooks.js
@@@ -146,9 -163,9 +146,9 @@@ export default class Notebooks extends
let notebook = this.notebook(id);
if (!notebook) continue;
const notebookData = qclone(notebook.data);
- await notebook.topics.delete(...notebook.data.topics);
+ // await notebook.topics.delete(...notebook.data.topics);
await this._collection.removeItem(id);
- await this._db.settings.unpin(id);
+ await this._db.shortcuts.remove(id);
await this._db.trash.add(notebookData);
}
}
diff --cc packages/core/collections/topics.js
index 006389e4e,2fd372c32..00e59eeca
--- a/packages/core/collections/topics.js
+++ b/packages/core/collections/topics.js
@@@ -116,8 -116,8 +116,8 @@@ export default class Topics
const topic = this.topic(topicId);
if (!topic) continue;
- await topic.delete(...topic._topic.notes);
+ await topic.clear();
- await this._db.settings.unpin(topicId);
+ await this._db.shortcuts.remove(topicId);
const topicIndex = allTopics.findIndex(
(t) => t.id === topicId || t.title === topicId