From 89f4d97ef33c22ff9fc30c3e7db711098fd05e24 Mon Sep 17 00:00:00 2001 From: Kieran Klukas Date: Tue, 28 Jul 2026 23:12:52 -0400 Subject: [PATCH] feat: nice toast errors --- src/editor.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/editor.ts b/src/editor.ts index fa95ee1..cbfd0d5 100644 --- a/src/editor.ts +++ b/src/editor.ts @@ -374,7 +374,13 @@ document.getElementById("save").addEventListener("click", async () => { const filledPages = pages.filter(p => p.image_key || p.markdown.trim()); if (!title || !date || filledPages.length === 0) { - toast("Fill in title, date, and add at least one page"); + const missing = []; + if (!title) missing.push("title"); + if (!date) missing.push("date"); + if (filledPages.length === 0) missing.push("at least one page"); + const last = missing.pop(); + const pretty = missing.length ? missing.join(", ") + ", and " + last : last; + toast("Missing " + pretty); return; } -- 2.51.2