fix: persist saved idea state across navigation, fix UTC timestamp

- Dashboard: track saved ideas in React state (Set), compare against
  suggestion texts to show "✓ Salvata" persistently
- Backend: append 'Z' to saved_at ISO timestamp so JS parses as UTC
  (fixes "2h fa" bug for UTC+2 users)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Michele
2026-04-06 02:06:16 +02:00
parent 228edf2a91
commit de769aca71
2 changed files with 31 additions and 19 deletions

View File

@@ -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)