diff --git a/js/post.js b/js/post.js index adc4622..a2a1245 100644 --- a/js/post.js +++ b/js/post.js @@ -119,7 +119,7 @@ const el = document.getElementById('postStats'); if (!el) return; - const moodStr = (post.mood || 'focused').toLowerCase(); + const moodStr = String(post.mood || 'focused').toLowerCase(); const moodIcon = moodIcons[moodStr] || '◈'; const moodColor = moodColors[moodStr] || '#d0d0d0'; const hr = post.heart_rate || post.bpm || 72; @@ -319,7 +319,7 @@ } catch (err) { // Fallback: try static JSON try { - const res2 = await fetch('api/data/posts.json'); + const res2 = await fetch('/api/data/posts.json'); const posts = await res2.json(); const post = posts.find(p => p.slug === slug); if (!post) throw new Error('Not found');