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: last nb duplicated when a new nb added (#57)
thecodrrbf563c334ee1
diff --git a/apps/web/src/components/notebook/index.js b/apps/web/src/components/notebook/index.jsindex 72e92c15d..522222e9e 100644--- a/apps/web/src/components/notebook/index.js+++ b/apps/web/src/components/notebook/index.js@@ -24,7 +24,8 @@ export default class Notebook extends React.Component {const nextItem = nextProps.item;return (prevItem.pinned !== nextItem.pinned ||- prevItem.favorite !== nextItem.favorite+ prevItem.favorite !== nextItem.favorite ||+ prevItem !== nextItem);}render() {diff --git a/apps/web/src/stores/notebook-store.js b/apps/web/src/stores/notebook-store.jsindex 2310b6c4d..373e46d39 100644--- a/apps/web/src/stores/notebook-store.js+++ b/apps/web/src/stores/notebook-store.js@@ -2,7 +2,7 @@ import { db } from "../common/index";import createStore from "../common/store";import { store as trashStore } from "./trash-store";-function notebookStore(set) {+function notebookStore(set, get) {return {refresh: function() {set(state => {@@ -13,10 +13,7 @@ function notebookStore(set) {add: async function(nb) {let notebook = await db.notebooks.add(nb);if (notebook) {- set(state => {- //TODO investigate ways to improve perf- state.notebooks = db.notebooks.all;- });+ get().refresh();}},delete: async function(id, index) {