diff --git a/backend/app/routers/content.py b/backend/app/routers/content.py index 8c9fc31..673756a 100644 --- a/backend/app/routers/content.py +++ b/backend/app/routers/content.py @@ -493,7 +493,7 @@ def save_idea( "id": str(uuid.uuid4())[:8], "text": text, "note": data.get("note", ""), - "saved_at": datetime.utcnow().isoformat(), + "saved_at": datetime.utcnow().isoformat() + "Z", "used": False, } ideas.insert(0, new_idea) diff --git a/frontend/src/components/Dashboard.jsx b/frontend/src/components/Dashboard.jsx index 79cfeb5..e210a28 100644 --- a/frontend/src/components/Dashboard.jsx +++ b/frontend/src/components/Dashboard.jsx @@ -15,6 +15,7 @@ export default function Dashboard() { const [loading, setLoading] = useState(true) const [suggestions, setSuggestions] = useState(null) const [suggestionsLoading, setSuggestionsLoading] = useState(false) + const [savedTexts, setSavedTexts] = useState(new Set()) useEffect(() => { Promise.all([ @@ -38,6 +39,12 @@ export default function Dashboard() { setRecentPosts(posts.slice(0, 5)) setProviderStatus(providers) setLoading(false) + // Load saved ideas to know which suggestions are already saved + api.get('/content/ideas').then(data => { + const texts = new Set((data.ideas || []).map(i => i.text)) + setSavedTexts(texts) + }).catch(() => {}) + // Load cached suggestions (won't regenerate if already generated today) if (providers?.llm?.configured && chars.length > 0) { setSuggestionsLoading(true) @@ -170,24 +177,29 @@ export default function Dashboard() { > Genera → - + {savedTexts.has(topic) ? ( + + ✓ Salvata + + ) : ( + + )} ))}