fix(rnotes): create notebook instantly without browser prompt
Skip the browser prompt() dialog — clicking "+ New Notebook" now immediately creates an "Untitled Notebook" and opens it for editing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6173e17bb9
commit
79f0ebb538
|
|
@ -740,16 +740,20 @@ Gear: EUR 400 (10%)</code></pre><p><em>Maya is tracking expenses in rF
|
||||||
}
|
}
|
||||||
|
|
||||||
private async createNotebook() {
|
private async createNotebook() {
|
||||||
const title = prompt("Notebook name:");
|
|
||||||
if (!title?.trim()) return;
|
|
||||||
try {
|
try {
|
||||||
const base = this.getApiBase();
|
const base = this.getApiBase();
|
||||||
await fetch(`${base}/api/notebooks`, {
|
const res = await fetch(`${base}/api/notebooks`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
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 {
|
} catch {
|
||||||
this.error = "Failed to create notebook";
|
this.error = "Failed to create notebook";
|
||||||
this.render();
|
this.render();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue