diff --git a/package.json b/package.json index f200536..ecdc333 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "sociowire-frontend", "private": true, - "version": "0.0.64", + "version": "0.0.65", "type": "module", "scripts": { "dev": "vite --host 0.0.0.0", diff --git a/src/api/client.js b/src/api/client.js index 0114352..7dd3ac2 100644 --- a/src/api/client.js +++ b/src/api/client.js @@ -424,15 +424,16 @@ export async function votePostTruth(postId, vote) { throw new Error(text || "truth vote failed"); } const data = await res.json().catch(() => ({})); - // Normalize response - API may return { truth: {...} } or flat object + // Normalize response - API returns { ok: true, truth: {...} } const truth = data?.truth || data || {}; const voteCount = truth.vote_count ?? truth.total_votes ?? truth.count ?? 0; - const aiScore = truth.ai_score ?? truth.ai ?? truth.truth_score ?? 50; - const userScore = truth.user_score ?? truth.user ?? truth.truth_score ?? 50; + const aiScore = truth.ai_score ?? truth.ai ?? 50; + const truthScore = truth.truth_score ?? truth.TruthScore ?? 50; // Final calculated score + const userVoteEffect = truth.user_score ?? 0; // Vote effect (+/- points), not the score return { ai_score: aiScore, - user_score: userScore, - truth_score: userScore ?? aiScore, // Main display score + user_score: userVoteEffect, + truth_score: truthScore, // Main display score - the final calculated value total_votes: voteCount, vote_count: voteCount, user_vote: vote, // The vote that was just cast diff --git a/src/components/Map/markerManager.js b/src/components/Map/markerManager.js index f4c3d13..114688c 100644 --- a/src/components/Map/markerManager.js +++ b/src/components/Map/markerManager.js @@ -1329,7 +1329,7 @@ export function openCenteredOverlay({ map, post, theme, fullScreen = false }) {