Skip to content

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

web: fix notebook title not updating on edit

Abdullah Atta9bd978b8c6a9
diff --git a/apps/web/src/components/route-container/index.tsx b/apps/web/src/components/route-container/index.tsx
index fabf5a574..caf1d30e8 100644
--- a/apps/web/src/components/route-container/index.tsx
+++ b/apps/web/src/components/route-container/index.tsx
@@ -111,7 +111,11 @@ function Header(props: RouteContainerProps) {
<Flex
className="route-container-header"
mx={2}
- sx={{ alignItems: "center", justifyContent: "space-between" }}
+ sx={{
+ alignItems: "center",
+ justifyContent: "space-between",
+ height: 42.8
+ }}
>
<Flex py={1} sx={{ alignItems: "center", justifyContent: "center" }}>
{buttons?.back ? (
diff --git a/apps/web/src/views/notebook.tsx b/apps/web/src/views/notebook.tsx
index 5ac3b846f..278caa375 100644
--- a/apps/web/src/views/notebook.tsx
+++ b/apps/web/src/views/notebook.tsx
@@ -438,6 +438,7 @@ function NotebookHeader({
context: NotebookContext;
}) {
const moreCrumbsRef = useRef<HTMLButtonElement>(null);
+ const notebooks = useNotebookStore((store) => store.notebooks);
const [notebook, setNotebook] = useState(context.item);
const [totalNotes, setTotalNotes] = useState(context.totalNotes);
const [crumbs, setCrumbs] = useState<{ id: string; title: string }[]>([]);
@@ -449,6 +450,12 @@ function NotebookHeader({
setIsShortcut(shortcuts.findIndex((p) => p.id === context.id) > -1);
}, [shortcuts, context.id]);
+ useEffect(() => {
+ (async function () {
+ setNotebook(await db.notebooks.notebook(context.id));
+ })();
+ }, [notebooks]);
+
useEffect(() => {
(async function () {
if (!notebook) setNotebook(await db.notebooks.notebook(context.id));