Fix notes.html: handle wrapped index.json format

This commit is contained in:
Echo
2026-01-30 17:40:31 +00:00
parent 4083d615ff
commit b0d7bd0a08
3 changed files with 86 additions and 3 deletions

View File

@@ -489,7 +489,8 @@
async function loadNotesIndex() {
try {
const response = await fetch(indexPath + '?t=' + Date.now());
notesIndex = await response.json();
const data = await response.json();
notesIndex = Array.isArray(data) ? data : (data.notes || []);
console.log(`Loaded ${notesIndex.length} notes from index.json`);
} catch (e) {
console.error('Failed to load notes index:', e);