diff --git a/modules/rnotes/components/folk-notes-app.ts b/modules/rnotes/components/folk-notes-app.ts index 29054e6..66d5555 100644 --- a/modules/rnotes/components/folk-notes-app.ts +++ b/modules/rnotes/components/folk-notes-app.ts @@ -740,16 +740,20 @@ Gear: EUR 400 (10%)

Maya is tracking expenses in rF } private async createNotebook() { - const title = prompt("Notebook name:"); - if (!title?.trim()) return; try { const base = this.getApiBase(); - await fetch(`${base}/api/notebooks`, { + const res = await fetch(`${base}/api/notebooks`, { method: "POST", headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ title }), + body: JSON.stringify({ title: "Untitled Notebook" }), }); - await this.loadNotebooks(); + const nb = await res.json(); + if (nb?.id) { + this.view = "notebook"; + await this.loadNotebook(nb.id); + } else { + await this.loadNotebooks(); + } } catch { this.error = "Failed to create notebook"; this.render();