From e00acf9ef1e4a552ffdde56d6574ca547c6c1f04 Mon Sep 17 00:00:00 2001 From: Jeffrey Smith Date: Sun, 29 Mar 2026 00:00:36 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20notes=20list=20not=20rendering=20?= =?UTF-8?q?=E2=80=94=20handle=20unwrapped=20API=20response?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sw.api.ext() auto-unwraps the JSON response body, so the list endpoint returns the array directly rather than {data: [...]}. Use `res.data || res || []` pattern matching tasks surface. Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/notes/js/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/notes/js/main.js b/packages/notes/js/main.js index 66148fe..b0341c5 100644 --- a/packages/notes/js/main.js +++ b/packages/notes/js/main.js @@ -308,7 +308,8 @@ } else { res = await api.get('/notes'); } - var items = (res && res.data) || []; + var items = (res && res.data) || res || []; + if (!Array.isArray(items)) items = []; // sort: pinned first, then by updated_at desc items.sort(function(a, b) { if (a.pinned !== b.pinned) return b.pinned - a.pinned;