Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(web): create note from empty list

tianma-ifa42922dbd033
diff --git a/apps/web/src/components/MemoListPane.test.mjs b/apps/web/src/components/MemoListPane.test.mjs
index 3de475cb..06411c41 100644
--- a/apps/web/src/components/MemoListPane.test.mjs
+++ b/apps/web/src/components/MemoListPane.test.mjs
@@ -19,3 +19,12 @@ describe("desktop memo list spacing", () => {
expect(source).toContain("lg:px-0 lg:pb-3 lg:[scrollbar-gutter:stable_both-edges]");
});
});
+
+describe("empty memo list creation", () => {
+ test("does not forward the React click event as a memo kind", () => {
+ const source = readFileSync(new URL("./MemoListPane.tsx", import.meta.url), "utf8");
+
+ expect(source).toContain('onClick={() => onCreateMemo()} disabled={isCreating}');
+ expect(source).not.toContain('onClick={onCreateMemo} disabled={isCreating}');
+ });
+});
diff --git a/apps/web/src/components/MemoListPane.tsx b/apps/web/src/components/MemoListPane.tsx
index 9efd27fd..f53e9f30 100644
--- a/apps/web/src/components/MemoListPane.tsx
+++ b/apps/web/src/components/MemoListPane.tsx
@@ -1395,7 +1395,7 @@ export const MemoListPane = ({
: t("memoList.noFilteredDescription")}
</div>
{memos.length === 0 && canCreateMemo && view !== "trash" && (
- <Button className="mt-4 justify-center" size="sm" variant="solid" onClick={onCreateMemo} disabled={isCreating}>
+ <Button className="mt-4 justify-center" size="sm" variant="solid" onClick={() => onCreateMemo()} disabled={isCreating}>
<FilePlus2 className="h-4 w-4" />
{t("memoList.newMemo")}
</Button>